MySQL reset lost root password

/etc/init.d/mysql.server stop
/usr/local/mysql/bin/safe_mysqld –user=mysql –skip-grant-tables –skip-networking &
/usr/local/mysql/bin/mysql
mysql> UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root';
mysql> FLUSH PRIVILEGES;
mysql> exit
/etc/init.d/mysql.server restart

Probably a good idea to clear the MySQL history afterwards or pull in the update from a txt file and delete!

You can leave a response, or trackback from your own site.

Leave a Reply