Loading....
Recent Article links:

Article

Reset 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.


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');
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.

Comments (5 comments)

[…] server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password. Read more at […]

Reset Forgotten MySQL Root Password at HowtoMatrix / February 29th, 2008, 10:50 am

[…] Articulo original posteado en   reset mysql root password. […]

Resetea Tu Password Root de MySQL / February 29th, 2008, 5:05 pm

[…] Fuente original: cmdln.org. […]

Resetear la contraseña de root de MySQL | ChristianGL.CoM / March 1st, 2008, 7:14 am

[…] Reset MySQL root password Diarsipkan di bawah: Mysql, Tips — bayuart @ 2:51 pm Tags: Mandriva, mysql lost password, mysql lost password root, mysql safe Dulu ada temen kesulitan nge-reset password root MySQL. Sebenere ini udah pernah di bahas di sini http://www.cmdln.org/2008/02/09/reset-mysql-root-password/. […]

Reset MySQL root password « bayu - mandriva - other Linux / March 3rd, 2008, 1:53 am

[…] server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password.  <!– […]

Reset Forgotten MySQL Root Password « IT From Tambaksari / April 2nd, 2008, 1:04 pm

What do you think?