A WordPress website, or any website for that matter, cannot work without a database. Using a database is an organized way of storing information and is accessible via phpMyAdmin in cPanel. All the information shown on your website are requested from the database.
Vodien web hosting plans provide more than one database. Correct database configuration is needed to make sure your WordPress website is requesting the data from the correct database. Incorrect database configuration results to an error page on your WordPress website as shown in the screenshot below.
The goal is for the wp-config.php file of your WordPress website to have the correct database name, database user, and database password.
|Important Note: Make sure this process is done overnight when there are least expected visitors on the website. Do the preparations listed below before applying changes to your website:
1. Check current database details in wp-config.php file.
|Note: If you can’t find the wp-config.php file in your website files, create one or check your backup files and upload it to your website directory.|
Step 1. Log in to cPanel.
Step 2. Click the File Manager button under Files category.
Step 3. Access your WordPress website files and right-click on wp-config.php file.
Step 4. Click Edit.
Step 5. Click Edit on the pop-up.
Step 6. Take note of the DB_NAME, DB_USER, and DB_PASSWORD which are on lines 23, 26, and 29 respectively. The values are in between the single quotes (‘).
2. Check the database details in MySQL Databases.
Step 1. In cPanel, click MySQL Databases in Databases section.
Step 2. Under Current Databases, check if the DB_NAME is on the list with its corresponding Privileged User. The privileged user should be the DB_USER in your wp-config.php file.
Step 3. If both DB_NAME and DB_USER matched with what’s in the wp-config.php file, it might be the password that is mismatched. The DB_PASSWORD can’t be seen but can be reset. Copy the DB_PASSWORD from wp-config.php file and use it as the new password.
Step 4. In MySQL Databases, scroll down to Current Users.
Step 5. Click on the corresponding Change Password link of the DB_USER.
Step 6. Enter the copied password from Step 3 in the two empty boxes.
|Note: This is not a password that you will use from time to time so it’s okay to use a long and complicated one. Just make sure to take note of the password so that you can put it later in wp-config.php file.|
Step 7. Click the Change Password button.
Step 8. Check the website if it’s already working. If the error stays the same, proceed to the next steps below.
3. Edit wp-config.php file with the correct information.
Step 1. Open the wp-config.php file and edit the following with the correct database information.
- Replace the database name in between the single quotes (‘) on line 23
- Replace the database username in between the single quotes (‘) on line 26
- Replace the database password in between the single quotes (‘) on line 29
Step 2. Save changes.
Step 3. Check your website if it’s now working.
If the database is missing, follow the steps below.
- Create a database and its user.
- Import your database backup to phpMyAdmin.
- Edit wp-config.php file with the correct information.