Browse by Popular
Domain Name
- What is a domain name?Eligibility criteria for registering .AU domain namesPremium domain names explained
Web Hosting
View AllEmail Hosting
View AllGoogle Workspace
- Getting Started with Google WorkspaceGoogle Workspace support resourcesTransferring an existing Google Workspace service to VentraIP
Account
- How do I reset my VIPcontrol password?How do I create a VentraIP account?How can I see who accessed my VentraIP account?
Troubleshooting
- How do I clear my browser cache?Troubleshooting a ‘500 internal server' errorTroubleshooting with a ping test
Troubleshooting “error establishing database connection” on a WordPress site
There are a few reasons that you might receive an “error establishing database connection” message from your WordPress. Here are some of the causes, and how to fix them.
The database connection details in your wp-config.php file are incorrect
The first thing you should do is verify that the database connection information in your website’s wp-config.php file is correct. You can open the wp-config.php file by following these steps:
- Log in to cPanel
- Click on the File Manager option
- Navigate to the public_html folder (or the folder in which your website is stored).
- Right-click on the wp-config.php file, then click Edit.
Once you have the file open, you can view the database’s name and the associated user under cPanel > MySQL Databases.
You can use this information to verify that the details inside the wp-config.php file are correct, except for the server address, which should be set to localhost.
More information about the wp-config.php file.
The MySQL extensions for PHP are not enabled
Sometimes the extension that allows PHP to connect to your MySQL database is not enabled. You can check if this is the case under cPanel > Select PHP Version.
Depending on the PHP version set, you will see any of the following extensions in the list.
- mysql
- mysqli
- mysqlnd
- nd_mysqli
- nd_pdo_mysql
Normally, enabling mysql or mysqli will resolve the problem. In some rare cases, you may need to enable mysqlnd and nd_mysql.
The MySQL Database for WordPress is corrupt and needs to be repaired
Sometimes there are issues with the data inside your website’s database, which can be fixed using WordPress’s inbuilt database repair tool. To use the tool, follow these steps:
- Login to cPanel
- Click on the File Manager option
- Navigate to the public_html folder (or the folder in which your website is stored).
- Right-click on the wp-config.php file
- Click Edit
- Add this line of code to the file
define('WP_ALLOW_REPAIR', true);
- Click Save Changes
- Navigate to http://www.mydomainname.com/wp-admin/maint/repair.php in your web browser
- Follow the prompts to repair the database
The MySQL Server is down or inaccessible for some reason
If you have tried all of the above and your website is still displaying the connection error, the MySQL Database Server may be down. In which case, you will need to contact our technical support team for assistance.