Monday, June 6, 2011

How to change a normal user's password in mysql


Suppose you want to change the user john's password to abc123#

mysql -u root -p
Give password.

Change databse
mysql> use mysql

mysql> update user set password=PASSWORD("abc123#") where User='john';

Flush privileges if needed
mysql> flush privileges;


Now login as john
mysql -u john -pabc123#

Thats it. Now you should be logined as john.

To check it, run
mysql>select user();

No comments:

Post a Comment

Be nice. That's all.