1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Lost Database Password

Lost Database Password

Website software such as WordPress and Drupal or database management software such as Workbench requires a database user and a password for users to access your database. If you have forgotten the password for your database user, you can set a new password inside cPanel.

Note: As an alternative to resetting the MySQL password, you may be able to find the existing password in your site's configuration file. If you are unsure where to locate the configuration file, please refer to our list of different scripts to find its location in the following article:


Setting a New Password for your MySQL User

To set a new password for a MySQL database user:

  1. Log in to cPanel and click MySQL® Databases in the Databases section.

    HostGator cPanel MySQL Databases

  2. Scroll down at the bottom and look for the Current Users section.

    HostGator cPanel MySQL Current Users

    Tip: You may also locate the MySQL Users section by clicking Jump to MySQL Users.

    HostGator MySQL Jump to MySQL Users

    Note: If you are making changes to a website and do not know which user to edit, you may view the user the site is connecting within its configuration file:
  3. Look for the MySQL user you would like to update and click the Change Password right next to it.

    HostGator MySQL Change Password

  4. Enter the new password in the Password text box. The Password Strength Meter on the page will identify the strength of the password.

    HostGator MySQL Set Password

    Note: You may use the generate password button to generate a secure password randomly.
  5. Click the Change Password Button when finished.

Re-Configuring Your Code

If you needed to reset the password to fix a website installation, the site's configuration file needs to be updated. Once the configuration file has been updated to reflect the new password, the site should work as it was prior.

If you are unsure of where your configuration file is, the following article will help you locate the file you need to edit the database password within: