Rescuing lost mysql root password

Run this:
mysqld_safe --skip-grant-tables --user=root &
Then:

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

Unfortunately, the info on the mysql site seems to be a bit wrong!

Leave a Reply