recover mysql password on localhost

Posted by joe.sixpack on June 04, 2006

hach, the powers of beeing superuser. Lost your database password? No big deal:


> /etc/init.d/mysql stop
> mysqld_safe --skip-grant-tables &
> mysql
mysql: use mysql;
mysql: update user set password=password('secret') where user='root';
mysql: quit;
> killall mysqld_safe
> /etc/init.d/mysql start
> mysql -u root -p
Enter password: secret
Welcome to the MySQL monitor. ....
mysql:

and off you go.
have fun

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments