If you use WordPress as a content management system, you are probably already on the error &# 8220; Error Establishing a database connection&# 8221; encountered. We show you how you can solve the problem.
Error Establishing a database connection (WordPress)
The error indicates only that the connection has failed to the database. Mostly a server error to blame. Unfortunately, the error can also occur if ye have not changed the system. The causes are many. We walk with you through the Most Common.
Caveat: If you get the error after a new installation, you have probably entered incorrect data in the installation mask. then if you have the correct data of a Reseller used checks. In addition, should you use supported browsers (not Internet Explorer 7 or 8).
Solution 1: Error Establishing a database connection - database is corrupted
Under certain circumstances, the database has been damaged, for example because a plugin has written into erroneous data. So you can eliminate the error:
- Make a backup of your WordPress site including databases! A backup tool is included in WordPress. You act at your own risk.
- Then you should first try the error in the front end and the back end (wp-admin) to get. If the same error is also displayed there, carry on to the next step. but if you get another error in the backend - about &# 8220; Database tables are unavailable&# 8221 ;, then you must repair the database.
- Open the file wp-config.php and adds directly to the database syntax the following code:
define (&# 8216; WP_ALLOW_REPAIR&# 8217 ;, true);
- Saves the file to the FTP server and opens this link:
http: // www.your website.com / wp-admin / maint / repair.php
- Now you have two options:Both options repair the WordPress database.
- Repair Database: Repairs the database.
- Repair and Optimize Database: Repaired databases and deletes contaminated sites.
- If the database after working again, removes her the above line back from the file wp-config.php.
Solution 2: wp-config.php file is incorrect
With the most common cause: the wp-config.php determines how Word Press establishes the connection to the database. When did you change about your root or the Database user password, you must make the change in this file.
First checks whether the following data is correct in your file:
Important: Your DB host entry may be different for your used as Hoster &# 8220; localhost&# 8221 ;. Read in addition also the WordPress Codex for the correct settings. Checks the code on any typographical errors.
Solution 3: MySQL server offline
Under certain circumstances, the fault lies not with you. If the MySQL service your hoster is offline, you also receive error messages. Login you one directly from your hoster to check whether the MySQL server is online.
Posted In: software