In the event of forgetting or misplacing your MySQL Database user password you will need to create a new user with a new password. You will also need to assign the newly created user to your existing database. Don't worry though, this will not erase or change any of the data in your database.
Before proceeding with the above step, it is advisable to check your websites configuration file to see if you can retrieve the database password from there.
Click here to view a list of common locations for configuration files.
Create a New Database User
- Log into cPanel
- In the Databases section, click MySQL Databases.
- Locate the MySQL Users section of the MySQL Databases tool.
- Under the Add New User, enter a username ensuring it is 7 Characters or shorter.
- In the Password field, enter a strong password.
- Confirm the password by retyping it in the second password field.
- Click Create User.
Assign New User to Database
- Under 'Add User to Database', select the newly created user from the User drop-down menu.
- From the Database drop-down menu, select the existing database for which you need the password reset.
- Click Add.
- From the MySQL Account Maintenance screen, select the privileges you wish to grant the user. You can use your existing user for the database as a guide on which privileges the new user requires.
- Click Make Changes.
Re-Configuring Your Code
Now that you have created a new user and password for your database, the site's configuration file needs to be updated. For help with locating your configuration file please click here to view a list of common locations for configuration files. Once the sites configuration file has been amended, the site should work as before.