Howtos / Articles

Change the MySQL root password

Ensuring you have a secure, and hard to guess MySQL root password is critical on production servers. If you don’t currently have a strong MySQL root password, please update it using the details below. Likewise, if you think someone may know the password, who shouldn’t, change the password immediately.

Run the following SQL statement on the MySQL server to change the root users password:

Obviously change ’1234′ with the password you would like to set. Make sure you set a strong password.

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

If you want to include \ or ‘ characters in the password, they will need to be escaped.

Replace ‘root’ with the name of another MySQL user account if you wish to change their password instead.

After making changes to permissions/user accounts, make sure you flush the provilege tables using the following command:


Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>