This is really meant as a comment on the previous answer, but is too big to fit into a StackExchange comment.
I too was suffering from this problem. So I created a new user with a
new-style hash, and now use that new user with no trouble. Here's
what I did:
[172.16.2.222:mysql Thu Nov 7 16:16:25 2013]> use mysql;
Database changed
[172.16.2.222:mysql Thu Nov 7 16:22:23 2013]> describe user;
describe user;
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Host | char(60) | NO | PRI | | |
| User | char(16) | NO | PRI | | |
| Password | char(41) | NO | | | |
I was happy to see that our Password column was already wide enough to
hold new-style hashes. (Had it been less than 41 characters wide, I
might not have had the courage to widen it :-)
[172.16.2.222:mysql Thu Nov 7 16:13:10 2013]> show variables like '%pass%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| old_passwords | ON |
| report_password | |
+-----------------+-------+
2 rows in set (0.06 sec)
old_passwords
being ON
is clearly the problem, so I
temporarily changed it:
[172.16.2.222:mysql Thu Nov 7 16:13:59 2013]> set session old_passwords = 'OFF';
Query OK, 0 rows affected (0.05 sec)
[172.16.2.222:mysql Thu Nov 7 16:14:12 2013]> show variables like '%pass%';
show variables like '%pass%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| old_passwords | OFF |
| report_password | |
+-----------------+-------+
2 rows in set (0.06 sec)
Then I created a new user:
[172.16.2.222:mysql Thu Nov 7 16:14:16 2013]> create user 'erich' IDENTIFIED BY 'SEKRIT PASSWORD';
... and took a look at the new hash:
[172.16.2.222:mysql Thu Nov 7 16:14:26 2013]> select * from user order by User;
+-----------+--------------+-------------------------------------------+--------
| Host | User | Password | Select_
+-----------+--------------+-------------------------------------------+--------
| localhost | someguy | 3d9505dd323e53f1 | Y
| % | someotherguy | 79b3df3b004bb855 | Y
| % | erich | *D2589EF6B59146801234567897BB190123456789 | N
| % | anotheroldguy| 60577e0d77b9212b | Y
Note how my hash is bigger than the others!
Just to be tidy, I set old_passwords
back to OFF
. This was
probably pointless, since I can't think why anyone would want to
create new users using old passwords, but who knows.
Anyway: this solved it for me.