Topic: How to change root password in mysql (Read 566 times)
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7975
40807 credits Members referred : 3
« on: Oct 24, 2006, 05:01:53 PM »
Recently I was trying to find out how to change the root password on my mysql server with no luck, so after some tweaks and searches I finally managed to make it work.
I know this sounds rediculous to a sysadmin, but I am just a poor php developer
Anyway bellow is the way to do it using only SQL statements so you can do it even using an interface like phpMyAdmin.
Bellow are the two SQL statements that you need to change any user's password (including the root user)
Code:
UPDATE user SET password=PASSWORD("here-goes-the-new-password") WHERE User='root'; FLUSH PRIVILEGES;
Those statements must run in the mysql database so from phpMyAdmin you have to select this db, or from console you have to do this :