Fix Sudden Error Establishing a Database Connection WordPress
Published by Jacob Martin on April 2, 2015
To Fix Sudden Error Establishing a Database Connection in WordPress apply the given Logical Flow Chart, this will allows you to get rid of this error without taking much unexpected Headache. Under this article we are discuses about the methods to fix the typical appearance of white page that display Error Establishing a Database Connection in WordPress suddenly.
Error Establishing a Database Connection WordPress : If you don’t have Idea About Technical Parts such as SQL, MySQL, PHPMyAdmin or what type of web hosting you are using, avoid this error repairing method.
This typical error generally occurs while working on website or making some modifications and sometimes side by side published a new post; unexpectedly user observe the dreaded white page with the error message “Error Establishing a Database Connection”. Generally this occurs with One Server running the both MySQL Server and Apache2 / Ngnix Web Server Software. For the server without having a web hosting control panel (like Rackspace Cloud Server, Amazon or MediaTemplate’s high end servers), the fix is generally to SSH as root and only restart MySQL server :
Vim 1 sudo /etc/init.d/mysql restart
Then restart Apache or perform a full reboot :
Vim 1 2 3 4 # restart apache
/etc/init.d/apache2 restart
# reboot
reboot
Generally error will remove. There are lots of reasons but normally it happens because of buggy plugins.
If you are unable to solve this error and a reboot does not fix it, open your wp-config.php file and add at the bottom:
define(‘WP_ALLOW_REPAIR’, true);
Point your browser towards your website’s this url :
Vim 1 http://www.yoursite.com/wp-admin/maint/repair.php
To repair the corrupt database it is essential to double check the details of the database. For a time with incorrect chmod value, deactivating W3 Total Cache like plugin can make the whole wp-config.php white – in its place of removing one single line, it completely deletes all the lines. So that we suggest to modify the ownership of wp-config.php to root in its place of giving it to Apache (www-data) and chmod it to as small value as possible so that no Plugin can overwrite it.
In fact you required to optimize your WordPress installation and most prominently, tweak MySQL Server to execute better. If you have newly migrated, you can also attempt to execute this SQL command (edit the statements, url etc.) :
Vim 1 UPDATE YOUR DATABASE NAME.wp_options SET option_value = ‘http://YOURURL’
WHERE wp_options.option_id =2 LIMIT 1;
Web applications like Plesk, cPanel, Webmin etc are generally run normally (if installed), so that Apache, PHP. Plesk, cPanel, Webmin are more connected to Perl than MySQL. GoDaddy, Bluehost etc. shared, VPS face these errors because of insufficient allocated resource. Try to upgrade to enhanced web host which are standard now like Rackspace, Amazon, HP Cloud etc.
To get rid of any other MYSQL error you have to learn more about this database, according to the MYSQL database professionals the best way to remove any error is restoring the database. But in this case it is important that your backup is updated because an outdated database may affect the stored data. You can also apply third party MySql repair tool this will allow you to get rid of any error without need of any backup file.
Steps to fix Sudden Error Establishing a Database Connection WordPress
Step 1: Download, install and launch the MySQl Database repair tool.
Step 2: Click ‘Select’ button to find and add corrupt MySQL database to the application and then select OK. Here you have the option of ‘Repair corrupt database which is stored at default location of MySQL’ and ‘Manual option to selct your database from default location’.
Step 3: After the scanning process you can now see the preview of the file in the left panel of the software.
Step 4: Now you can start the reairing process, just click on Repair button. A dialoguie box will appear. Click Yes.
Step 5: After successful completion of the process, a message box is displayed as ‘repair process finished successfully’. Click ‘OK’ to close the message box.
498 Total Views 1 Views Today