Reset MySQL Root PasswordBy Dag, on December 30th, 2016
If you have mysql- or root user shell access to the linux host where your mysql is running, you can reset the password like this:
(Debian based example).
First, stop the daemon.
Second, start mysql without privileges:
#mysqld --skip-grant-tables &
Third, connect to the daemon and make changes:
#UPDATE mysql.user SET Password=PASSWORD('NewPassword') WHERE User='root';
Now stop the daemon and start it normally:
It might be sufficient with a simple restart too, but I like it the explicit way just to be sure.
For more information on this subject, visit the official MySQL reference: