Bug #35790 Passwords work based on host specified.
Submitted: 3 Apr 2008 9:50 Modified: 4 Apr 2008 19:25
Reporter: Felix Bowman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.51a OS:MacOS (10.5.1)
Assigned to: CPU Architecture:Any
Tags: localhost, passwords

[3 Apr 2008 9:50] Felix Bowman
Description:
With host set as localhost, when trying to connect to MySQL as a user with a set password MySQL only allows access without the password.

1>
BS-IT-Felix:bin Felix$ ./mysql -u felix -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'felix'@'localhost' (using password: YES)
BS-IT-Felix:bin Felix$ 
1>

2>
BS-IT-Felix:bin Felix$ ./mysql -u felix   
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 143
Server version: 5.1.23-rc MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 
2>

When host is set as 127.0.0.1 or any other host, the password works.

3>
BS-IT-Felix:bin Felix$ ./mysql -h 127.0.0.1 -u felix
ERROR 1045 (28000): Access denied for user 'felix'@'127.0.0.1' (using password: NO)
BS-IT-Felix:bin Felix$ 
3>

4>
BS-IT-Felix:bin Felix$ ./mysql -h 127.0.0.1 -u felix -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 145
Server version: 5.1.23-rc MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 
4>

How to repeat:
Passwords set in MySQL don't apply to accounts logging in with host set as localhost. Works otherwise.
[3 Apr 2008 14:54] Felix Bowman
Logged in as root and ran the following query. It matched a row but it did not update it at all.

mysql> UPDATE user SET Password=Password('pma') WHERE User='pma';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0
[4 Apr 2008 19:25] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read about how MySQL Access Privilege System Works at http://dev.mysql.com/doc/refman/5.1/en/privileges.html and http://dev.mysql.com/doc/refman/5.1/en/connection-access.html