Lost Root MySql Password
December 31, 2004
Just follow these simple steps to reset the password. The trick here is you start the server and tell it not to use the grant tables. This allows you to reset the root password.
- Stop the MySql server.
- /usr/bin/mysqld_safe --skip-grant-tables &
- mysql -h localhost
- use mysql
- update user set password = password('.......') where user = 'root' and host='localhost';
- quit
- Restart the server and run as normal.
13 Comments