Lost Database Password

If you've forgotten the password to your MySQL database user, you must create a new user with a new password, and then assign that user to the database. This will not erase or change any of the data in your database.

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:

 

Create a New User

  1. Log into cPanel.
  2. In the Databases section, click  MySQL Databases.
  3. Locate the MySQL Users section of the MySQL Databases tool. To quickly find this section, click Jump to MySQL Users.
  1. Under Add New User, enter a username. Be sure that the username is 7 letters or shorter.
  2. In the Password field, enter a password.
  3. Retype the password in the Password (Again) field.
  4. Click Create User.

Assign New User to Database

  1. Under Add User to Database, select the newly created user from the User drop-down menu.
  2. From the Database drop-down menu, select the existing database for which you need the password reset.
  3. Click Add.
  4. From the MySQL Account Maintenance screen, select the privileges you wish to grant the user or select ALL PRIVILEGES.
  5. Click Make Changes.
You may remove the old user from the database by clicking the red X next to the user in the Current Databases table.

Re-Configuring Your Code

Now that you have a new user and password for your database, the site's configuration file needs to be updated. Once the configuration file has been updated to reflect the new database username and password, the site should work as it was prior.

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to disable anonymous FTP

Anonymous FTP is disabled by default. You will require a Business plan or better to enable...

Directory Listing Denied, This Virtual Directory does not allow contents to be listed

Are you seeing this error message when trying to view your site? "Directory Listing DeniedThis...

Latest Visitors

You will find an icon for this in cPanel, under the Logs section. This function will show the...

I accidentally deleted the public_html or www folder

If you delete the www folder, your site should still load properly. If you delete the...

How to Create/Edit/Delete a File Using the File Manager

You will need to have a basic understanding of how to navigate the File Manager in order to...