If you’re having trouble connecting to your WordPress database, there are a few things you can do to try and fix the issue. One common cause of database connection errors is an incorrect or outdated database connection string in your wp-config.php file. Here’s how you can fix this issue using cPanel’s file manager:
Step 1: Log in to cPanel
Log in to your cPanel account using your username and password.
Step 2: Open the file manager
Once you’re logged in, find the “File Manager” icon and click on it.
Step 3: Navigate to the wp-config.php file
In the file manager, navigate to the directory where your WordPress installation is located. Typically, this will be in the “public_html” folder. Once you’re in the correct directory, locate the “wp-config.php” file and click on it to open it.
Step 4: Check the database connection string
In the wp-config.php file, locate the section that contains your database connection information. This should look something like this:
define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');
Make sure that the values for DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are correct. If you’re not sure what these values should be, you can check with your hosting provider or look in the “MySQL Databases” section of cPanel.
Step 5: Save the changes
If you’ve made any changes to the wp-config.php file, be sure to save your changes before closing the file.
Step 6: Check database user privileges
In cPanel, navigate to the “MySQL Databases” section and find the user associated with your WordPress database. Check to make sure that the user has all privileges granted and the password is correct. If the password is incorrect, reset it.
By following these steps, you should be able to fix any issues with your WordPress database connection string and get your site up and running again.