Reset Forgotten MySQL Root Password 

Have you ever forgotten the root password on one of your MySQL servers? No? Well maybe I’m not as perfect as you. This is a quick h00tow (how to) reset your MySQL root password. It does require root access on your server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password.

First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.

mysqld_safe –skip-grant-tables

You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password. 

mysql –user=root mysql

update user set Password=PASSWORD(‘new-password’) where user=’root’;
flush privileges;
exit;

Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.

Reference:
http://www.howtoforge.com/reset-forgotten-mysql-root-password

 

Advertisements

One thought on “Reset Forgotten MySQL Root Password

  1. I was wondering if you ever considered changing the layout of youjr website?

    Its vety well written; I love what youve got to
    say. But maybe you could a little more in the way of content so people could connectt with it better.
    Youve got an awful lot of text for only having 1 or
    two images. Maybe you could space it out better?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s