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') 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.
Identica
Twitter
LinkedIn
GooglePlus
[…] server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password. Read more at […]
[…] Articulo original posteado en reset mysql root password. […]
[…] Fuente original: cmdln.org. […]
[…] 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/. […]
[…] server. If you have forgotten that password wait for another article. Original article posted on 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. Original article posted on 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. Original article posted on reset mysql root password. […]
Thank you! It worked. I clearly wonder why they aren’t better instructions out there in clear-concise English such as yours.
I don’t have mysqld-safe.exe with my sql version that came with wampserver but went ahead anyways using mysqld.exe.
Why do they make it so hard for newbies to get a handle on it. It really was phpAdmin that allowed me to change the password in the table using “TEXT” only to see later it was converted it to Hex in the user table after I was finally allowed to see the table again with your solution.
Glad you found it useful.