Reset Forgotten MySQL Root Password

Posted by Weston Ganger

I have forgotten my root password to MySQL before. This was a life saver.

It requires root access to the system obviously though.


# Start MySQL and skip the grant tables that store passwords
mysqld_safe --skip-grant-tables

# Connect to MySQL without a password
mysql --user=root mysql

# In the mysql prompt run the following commands:
UPDATE USER SET Password=PASSWORD('new_password') WHERE user='root';
flush privileges;
exit;

Then just kill your running mysqld and restart it normally.


Related External Links:

Article Topic:Software Development - Linux

Date:October 27, 2015

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected