Change Database Root Password

Valid for versions 120 through the latest version



Last modified: February 28, 2024


This interface allows you to set a server’s MySQL® or MariaDB® root account password.

  • Ensure that you set a complex password. If an attacker were to compromise this password, they would have access to any of your server’s databases.

  • By default, cPanel & WHM’s implementation of MySQL and MariaDB stores the MariaDB and MySQL root account password in the /root/.my.cnf configuration file. Do not edit this file manually.

  • In cPanel & WHM version 118 and earlier, we titled this interface MySQL Root Password and its section in the WHM interface SQL Services.
  • You do not need to remember the database server’s root account password unless you plan to log in to MySQL or MariaDB as the database root user.

Create password

To set the MySQL or MariaDB root account password, perform the following steps:

  1. Enter and confirm the new password in the appropriate text boxes.

    • The system evaluates the password that you enter on a scale of 100 points. 0 indicates a weak password, while 100 indicates a very secure password.
    • Some web hosts require a minimum password strength. A green password Strength meter indicates that the password is equal to or greater than the required password strength.
    • Click Password Generator to generate a strong password. For more information, read our Password & Security documentation.
    Do not use asterisks ( * ), periods ( . ), or any other special characters in your database root password. If you do, phpMyAdmin will not function. If you use the Password Generator feature, select the Numbers button under advanced.

  2. Click Change Password.

Remote MySQL or MariaDB

If you use a remote MySQL or MariaDB server, you must choose whether you change the local or the remote server’s root database account password. By default, the system selects the remote MySQL server.


When the remote server is also a cPanel & WHM server, you must perform additional steps:

  • If you change the remote MySQL or MariaDB root password on the hosting server, you must update the remote server’s /root/.my.cnf configuration file.

  • If you change the remote database root password on the remote server, you must update the profile on the hosting server, and then reactivate the profile.


For more information, read our Troubleshoot MySQL® Profiles documentation.

Additional Documentation