Recover the root MySql Password
Forget your root mysql password? That's really not good, but it's also not a fatal error. If you have root access to the box you can rememdy this problem. Basically you forcibly stop the service, tell it to start again and ignore all privileges (very insecure), reset the password, and reload the privileges.
/etc/init.d/mysqld stop
safe_mysqld --user=root --pid-file=/usr/local/mysql/data/mysqld.pid --skip-grant-tables &
mysql -u root mysql
update user set password=password('newpass') where User='root' and host='localhost';
flush privileges;
Leave A Reply
- 5 Replies
Replies
lorgs
June 5th 2007
I am starting back my MySql and have password trouble...thank you so very much.
laurie
July 27th 2008
Thanks a lot. I tried a bunch of other stuff from google. Yours waa the only one that worked.
petka
December 9th 2009
Reverse MySQL hashed passwords. http://petka.biz/hash.pl
Petka
January 13th 2010
Unhash passwords
rie
March 31st 2010
which box did you mean that can remedy? ive been trying cmd and mysql server client. plsss help



