mysql root password recovery - reset password

If you ever loose your mysql root password (remember is not the same as the system root password) you can recover it following this steps,
But before those steps, i should say that i put them in a program at www.ehcp.net/other/resetmysqlrootpass.sh.txt
You may download that prog and run on your server, or you may directly run that in your ehcp dir.

Here are manual steps:
first, stop your mysql, by
/etc/init.d/mysql stop
then,

Start MySQL in safe mode
mysqld_safe --skip-grant-tables &
Enter the console as root

mysql -u root
UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';
update mysql.user set plugin='' where User='root';
FLUSH PRIVILEGES;

After this, you may use your new_password... for ehcp install or anything..

note that, ehcp asks for your mysql root password to install its mysql data..

Forums: