Bug #64522 | Effective UID issue | ||
---|---|---|---|
Submitted: | 2 Mar 2012 11:28 | Modified: | 6 Mar 2012 18:29 |
Reporter: | Sebastien Termeau | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 5.1.61, 5.5.21, 5.6.5 | OS: | Linux (RHEL 6.2 64 bit) |
Assigned to: | CPU Architecture: | Any | |
Tags: | 5.5.21 |
[2 Mar 2012 11:28]
Sebastien Termeau
[6 Mar 2012 16:16]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior: [sveta@delly mysql-test]$ ../client/mysql -S /home/sveta/src/mysql-trunk/mysql-test/var/tmp/mysqld.1.sock ERROR 1045 (28000): Access denied for user 'sveta'@'localhost' (using password: NO) [sveta@delly mysql-test]$ su Password: [root@delly mysql-test]# ../client/mysql -S /home/sveta/src/mysql-trunk/mysql-test/var/tmp/mysqld.1.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.5-m8-debug-log Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \q Bye [root@delly mysql-test]# cat /proc/self/loginuid 500[root@delly mysql-test]# exit exit [sveta@delly mysql-test]$ su - root Password: [root@delly ~]# ../client/mysql -S /home/sveta/src/mysql-trunk/mysql-test/var/tmp/mysqld.1.sock -bash: ../client/mysql: No such file or directory [root@delly ~]# /home/sveta/src/mysql-trunk/mysql-test/../client/mysql -S /home/sveta/src/mysql-trunk/mysql-test/var/tmp/mysqld.1.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.5-m8-debug-log Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \q Bye Could you post similar session from your environment?
[6 Mar 2012 18:17]
Sebastien Termeau
Hi, I wasn't able to reproduce this when login as root neither. Could you please try to login as a user with a uid different than 0?
[6 Mar 2012 18:29]
Sveta Smirnova
Thank you for the feedback. Verified as described: [sveta@delly mysql-test]$ su - foobar Password: su: warning: cannot change directory to /home/foobar: No such file or directory -bash-4.1$ home/sveta/src/mysql-5.5/mysql-test/var/tmp/mysqld.1.sock^C -bash-4.1$ ../client/mysql -h127.0.0.1 -P13000 ERROR 1045 (28000): Access denied for user 'sveta'@'localhost' (using password: NO)
[9 Nov 2012 1:20]
Richlv -
maybe this bit is useful. at least in my environment mysql only does this if .my.cnf file is present (only with [client] and password=aa directives) so "su - user" with .my.cnf - uses original (wrong) user. without - uses the correct one.
[21 Aug 2013 14:40]
Prabhu Shankar
Is this bug fixed?
[22 Dec 2014 18:16]
Colin Kuskie
I'm having similar issues. I remotely log into a server using opensuse 13.1/mysql Ver 14.14 Distrib 5.6.12 on 64-bit. I use sudo to become root Then I use su to become another user. If I try to connect to mysql without specifying a user on the command-line client, then it fails with this response: ERROR 1045 (28000): Access denied for user 'colin'@'localhost' (using password: NO) This is exactly the behavior described by the original poster.
[22 Mar 2016 5:45]
Calvin Sun
Fix of bug#64622
Attachment: bug64522.patch (application/octet-stream, text), 756 bytes.