Hostwinds Tutorials
Search results for:
Table of Contents
Tags: cPanel
When you receive this error, the PHP code cannot retrieve information from the database where everything is stored.
Several potential causes for this could be:
This error will typically manifest when visiting the site in question by displaying "ERROR ESTABLISHING DATABASE CONNECTION."
If you are getting this database error, you can try these steps to resolve the issue:
Once you have done so, you need to assign the new user you just created to the proper database. Go to "Add User to Database" to do so.
Note: You'll need to change your wp-config file to use the new username and password to complete this section correctly.
If you suspect your database may be corrupt, you can try to repair it with the built-in repair function in WordPress.
To do so, start by moving to the File Manager in cPanel and find your wp-config file.
Look for the line that starts with "That's All, Stop Editing" and above it, place this snippet of code:
define('WP_ALLOW_REPAIR', true);
Once you have done so, visit http://www.yourdomain.com/wp-admin/maint/repair.php.
You should see a page with options to repair or repair and optimize. Note: Make sure to make the repair quickly. This page is not secure, and any person can access it at any time. If you do the repair in this way, make sure you remove that line from the wp-config file when you have finished, keeping your site safe.
Written by Hostwinds Team / December 13, 2016