Recover MySQL Root Password
Monday, April 20, 2009
To recover the password for the root account on a MySQL server use the following steps. Essentially, it can be done by restarting the daemon without the grant tables.
1. Stop the currently mysql daemon# /etc/init.d/mysql stop2. Start the daemon without the grant tables# mysqld_safe --skip-grant-tables &3. Login to mysql as the root user ... it will have a blank password# mysql -u root4. Reset the root account passwordmysql> use mysql;mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root';mysql> flush privileges;mysql> quit5. Stop & restart the daemon# /etc/init.d/mysql stop# /etc/init.d/mysql start
I found this tip here.
posted by Don @ 9:46 AM,
0 Comments:
Links to this post:
About This Blog
This blog is a place where I hope to put the snippets and trimmings of my geek'dom ... code samples that have served me well, tech links and other such things that'll I find useful. In short, any time I have to Google something, I tend to post it here for others to find as well.
Also, having owned 'digital-penguin.com' for many years and having worked with many a fellow geek, this site also serves as a place where I can always be found.

Post a Comment