Skip to main content

How to Change the MySQL Root Password in WHM

Change the MySQL root password within the WHM interface to update the primary administrative password for the MySQL database server. This action is performed by a Server Administrator and affects the root account used by the server's database...

Change the MySQL root password within the WHM interface to update the primary administrative password for the MySQL database server. This action is performed by a Server Administrator and affects the root account used by the server's database management system.

Before you begin

You will need:

  • Root access to the WHM interface

  • A secure, unique password for the MySQL root account

  • A moment of downtime for the MySQL service if the server requires a restart to apply the change

Changing the MySQL Root Password

  1. Log in to WHM.

  2. Navigate to SQL Services > MySQL Database Wizard (or MySQL Management depending on your specific version).

  3. Locate the option to change the MySQL root password.

  4. Enter the current MySQL root password.

  5. Enter the new MySQL root password.

  6. Confirm the new password by typing it a second time.

  7. Click Change Password.

Warning: Changing the MySQL root password can cause issues with scripts or applications that rely on the root password to connect to the database. Ensure you have updated any local configuration files or scripts that use the root account before proceeding.

Confirm the result

  • The system will display a confirmation message stating that the MySQL root password was successfully updated.

  • You can verify the change by attempting to log into the MySQL command line using the new root password.

If you cannot log in after changing the password

If you are unable to connect to the database after the change, it is likely that a local configuration file or a specific application script is still attempting to use the old password.

  1. Check the my.cnf or my.cnf.cnf files for any hardcoded credentials.

  2. Verify that any automated scripts or cron jobs that utilize the MySQL root account have been updated with the new password.

  3. If the issue persists, ensure the MySQL service is running correctly by checking the service status in WHM.

Limitations

This procedure only changes the password for the MySQL root account. It does not change the passwords for individual MySQL users or databases created for specific cPanel accounts.

Did this answer your question?