Last Updated: February 25, 2016
·
480
· andrewjsledge

Reset mysql root passwd

Or, how to save your keister.

Open a shell session to the database server with root or a user with permissions to control the mysql process.

Stop the mysql process.

Start it again under

$ mysqld --skip-grant-tables &

Now log into mysql. Run the reset password for root

mysql> UPDATE mysql.user SET Password=PASSWORD('supersecret') WHERE User='root';
mysql> FLUSH PRIVILEGES;

Kill the previously started mysql server instance.

Start the service up as usual.