Back to Tools and Features

How To Manually Reset My MySQL Password

This article is for Site Manager accounts, find out what service you are using here.

If you change the MySQL root password via the /etc/my.cnf file and not through the Site Manager >> Install & Manage page, you may run into issues with other applications being able to access MySQL. You may also crash MySQL entirely.

Correctly Updating the MySQL Password

  1. Open the Site Manager.
  2. Click Site Applications.
  3. Click on the Edit icon next to MySQL.
  4. Click Next on the screen that pops up.
  5. Type in the desired password. Click Finish.

Repairing the MySQL Password

If you run into this situation, the following should help you update your MySQL password correctly to get things working. You will need working knowledge of the command line or use the commands tool through Site Manager >> File Manager to follow this guide.

The error that you will usually see regarding this issue is:

 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 Here are the steps to follow, the commands are highlighted in gray: 

  1. Get the mysql process command with ps auxww 
  2. Get the current root password. head /etc/my.cnf 
  3. Kill mysql (nicely). kill ‘pid of mysql’ 
  4. Use the string shown in the ps auxww output to start MySQL again. Add "–skip-grant-tables &" to the end of it.
    An example would be [it should ALL be on one line]:
    /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ --open-files-limit=800 --pid-file=/var/lib/mysql/ --socket=/var/lib/mysql/mysql.sock --port=3306 --skip-grant-tables &
  5. Get into mysql. mysql 
  6. Select the MySQL database. use mysql; 
  7. Reset the root password by running the following replacing their password with the current root password found in step 2.
    UPDATE user SET password = OLD_PASSWORD('theirpassword') WHERE user = 'root'; 
  8. Exit mysql. Ctrl+D
  9. Restart mysqld. /etc/init.d/mysqld restart 

 From there, MySQL should be running. Contact Support with any further questions.

Related Articles

How To Create And Download A Backup
How To Delete Your Content
Does WestHost Offer Ruby On Rails Support
What Perl Modules Are Installed By Default
Does WestHost Allow TeamSpeak

Can’t Find what you need?

No worries, Our experts are here to help.