I've compiled & installed a mysql-5.1.59 on a x86_64 linux server.
First I set root password in cli and login:
$ bin/mysqladmin -uroot password 'somepass'
$ bin/mysql -uroot -p 'somepass'
mysql>
Login succeed!
Then I created a user using SQL statements:
mysql> grant all privileges on mydb.* to 'myuser'@'localhost' identified by 'somepass';
mysql> flush privileges;
The password is exactly the same as root.
But after I queried:
mysql> select host,user,password from mysql.user;
I noticed that the password values of the two account are not the same. And I tried login mysql with myuser but failed.
By the way if I change the root password this way:
mysql> update mysql.user set password=PASSWORD('somepass') where user='root';
mysql> flush privileges;
Then I can't login mysql with root anymore:
$ bin/mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
This never happens on my other servers. It seems like the issue has something to do with the os. How could the hashed values different between each other? Thanks!