Oct 22, 2018

How to reset root password of MySQL

According to MySQL document: you can restart the server with --skip-grant-tables. Then you can login and change the root password.

MySQL 5.7.6 and later:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

$ mysqladmin -u root -p shutdown
Then restart the server normally.