reset mysql root password

reference

You may forget root password of your mysql database, follow instruction below to reset it.

  • Add a entry in my.cnf:
1
2
[mysqld]
skip-grant-tables
  • then restart mysql server, now you can login as root without prompting password.
  • execute as below:
1
2
3
use mysql;
update user set password=password("123456") where user='root';
flush privileges;
  • Do not forget to delete the entry you have added in step 1 after this command:

reset mysql root password
https://rug.al/2013/2013-08-05-reset-mysql-root-password/
Author
Rugal Bernstein
Posted on
August 5, 2013
Licensed under