I have a MySQL server and lost its password. I found that there is a way to reset the password once you lost it. Even the root’ password.

Following are the steps to do this.

1. Stop the mysqld daemon process.
2. Start the mysqld daemon process with the –skip-grant-tables option.
3. Start the mysql client with the -u root option.
4. Execute the UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’;
5. Execute the FLUSH PRIVILEGES; command.

Advertisement