Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to change the root password for phpmyadmin. I've tried doing this a few times using this:

$ mysql -u root -p
use mysql;
update user set password=PASSWORD("NEWPASSWORD") where User='root'

But then when I go to login using the new password or even the old password, I'm denied access. Any help is appreciated!

share|improve this question

I was able to do this by instead of doing update
update user set password=PASSWORD("newpassword") where User='root'
but using
set password = password ("newpassword");
flush privilges

share|improve this answer
Could you please accept your own answer here? Thanks! – splattne Sep 9 '10 at 6:32

Because really what you have to change is the root password of MySQL.

As a side note, I suggest you to block root from logging on phpmyadmin and only login to it using specific users with access to specific databases, unless it is strictly necessary to have root access (like, there's no console access to the DB server).

If really necessary, at least run phpmyadmin over SSL, since passing the MySQL root password over clear text connection is not very wise.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.