Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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, thanks!

share|improve this question
add comment

2 Answers

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
quit

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

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
add comment

Your Answer

 
discard

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.