Take the 2-minute tour ×

I have a little problem with my phpmyadmin, in fact I accidentally delete multiple user accounts. Since it is impossible to connect without the error:


I have search a little on the net before, and even the technic:

UPDATE mysql.user SET Password = PASSWORD ('') WHERE User = 'root';

does not work, or I didn't understood how it worked.

I'm on FreeBSD 8.1, my version of PhpMyadmin is 2.11.

Thank you in advance for your answers.

share|improve this question

3 Answers 3

I summarised my solution here: http://snippets.dzone.com/posts/show/13267

sudo stop mysql
sudo mysqld --skip-grant-tables --skip-networking

mysql> update mysql.user set password = password('your_new_password') where user = 'root';
mysql> flush privileges;
mysql> exit;
sudo mysqladmin shutdown
sudo start mysql
share|improve this answer
please don't post the exact same answer multiple times. If the question is a duplicate, flag it as such. –  Mat Jun 19 '11 at 12:02
missing from the above snippet -- though explained in the offsite summary. 1) After running the first sudo mysqld... , switch to a different terminal window. 2) Prompt for the the new password when running mysqladmin shutdown: sudo mysqladmin shutdown -u root -p –  here Apr 24 '13 at 16:37

This one worked for me, no side effects. https://help.ubuntu.com/community/MysqlPasswordReset

share|improve this answer

Please follow the instruction from the below link to reset your root password.You have to do it from outside mysql.

Resetting MySql Password

Forgetting your MySQL password can be a real headache for you.Here are some easy steps that you can follow to recover MySql password under Windows Stop MySql

You have to stop MySql service before you proceed.In Windows environment, go to 'Task Manager' and Under 'Service' tab find MySQL and stop it. Write Sql to change your password

All you need to do is to create a text file and put the below two lines into that. UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES; Save it under C:\ drive and give it a name 'mysql-init.txt' Time to restart MySQL by your own.

Now it's time to restart your MySQl which you stopped in before but this time from command line. C:> C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt Finishing up!

Now you can log in with your new password. When you finish remove the file that you created in the previous stage.

Also there is a link (http://kaziprogrammingblog.osinweb.com/article/showarticle/Resetting-MySql-Password) where I have explained the same thing.

Hope this will help..:)

share|improve this answer

Your Answer


