mysql : reset root password, change password, etc

Crap, I’ve just forgotten my mysql root. I found a lot of way to restore password root of mysql. Well, in one side, it’s a good thing that we can recover our password again, in the other side I feel if it’s so easy to recover the root password, that means BIG HOLE.. isn’t it? Hmm, sometimes as DBA, we have to pick the double-edge sword to make it useful knowing the threats.

You can see a lot of method to change user’s password following this link.

You also can see a lot of method to recover root password. One of them is this source.

In the root password recovery process, I can’t start the mysqld_safe. It fails saying:

Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
070105 20:23:40  mysqld ended

The problem for this error log is that system can’t access /var/run/mysqld. So the solution I’ve found for this error is checking the ownership of /var/run/mysqld . You can change the ownership with chown to that folder and change the moderation if necessary.

Now I can execute :

mysqld_safe --skip-grant-tables &

And change the root password.. Voila..

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s