Thursday, March 21, 2013

Change MySql Password for 'root' or any other user

Although you can use mysqladmi,

$ mysqladmin -u root -p'oldpassword' password newpass
 It doesn't really tell you much about the mysql structure as to where that password is stored and stuff. Better is, that you do it this way :

Login into the root account (blank password for the first time), then


mysql> use mysql;
 
mysql> UPDATE user SET password=PASSWORD("pranshu_bajpai") where User='root'; 

mysql> flush privileges;
mysql> quit

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete