Bug #35695 Error 1045 for user with right password but not without it
Submitted: 31 Mar 2008 8:09 Modified: 31 Mar 2008 10:55
Reporter: Pablo Carranza Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S2 (Serious)
Version:5.0.51 OS:MacOS (PowerPC G4)
Assigned to: CPU Architecture:Any
Tags: Error 1045, not root

[31 Mar 2008 8:09] Pablo Carranza
Description:
I've installed mysql from macports in the last G4 available version, created all the needed stuff, created databases, etc.
I connect to the DB with root without any problem, but then I create a user with a statement like this: CREATE USER PMA IDENTIFIED BY 'pass'; logout mysql and then try to log in with this newly created user: "mysql -u PMA -p='pass'" or "mysql -u PMA -p=pass" and got a 1045 error.
The funny thing is that after a long frustrating time I tryed to log in without password: "mysql -u PMA" and it loged in without complains.

¿How come?

Regards.

How to repeat:
Follow previous instructions.

Suggested fix:
No idea.
[31 Mar 2008 10:51] Valeriy Kravchuk
Thank you for a problem report. Please, send the results of:

select user, host from mysql.user;
[31 Mar 2008 10:54] Pablo Carranza
This is it:

+------+--------------+
| user | host         |
+------+--------------+
| pma  | %            |
| root | 127.0.0.1    |
|      | localhost    |
| root | localhost    |
|      | wyrmtv.local |
| root | wyrmtv.local |
+------+--------------+
6 rows in set (0.00 sec)

The user is pma.

And also:

mysql> select user, host, password from mysql.user;
+------+--------------+-------------------------------------------+
| user | host         | password                                  |
+------+--------------+-------------------------------------------+
| root | localhost    | *73FA23CE177403ADDDE929058D263744249D4F22 |
| root | wyrmtv.local |                                           |
| root | 127.0.0.1    |                                           |
|      | localhost    |                                           |
|      | wyrmtv.local |                                           |
| pma  | %            | *6C8DC88838BA26F23FC09ED48861E966C911B4CB |
+------+--------------+-------------------------------------------+
6 rows in set (0.00 sec)

Regards
[31 Mar 2008 10:55] 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 carefully about GRANT syntax at http://dev.mysql.com/doc/refman/5.0/en/grant.html

Your case is "The simple form user_name is a synonym for user_name@'%'." When you don't enter password you just connect as anonymous user which created by mysql_install_db script. You can check it with SELECT USER(), CURRENT_USER() statement.