Share Article To

If you are running WordPress website or a WordPress developer it is very common issue that you are getting below message while accessing your WordPress website.
Screen Shot 2015-04-05 at 12.28.05 am

This is not a big issue but sometime this may feels you frustrated while resolving. In this article we will let you know the all the possible reason and their solutions.

Reasons:
– Your database server is unresponsive, in other words mysql server stopped(mostly in your local system).
– You changed the your database login credentials but forgot to change it in wp-config.php file.

Solution:
– If your website is on server then login to the cPanel and try to access the phpmyadmin. If it is opening then it is clear that database server is ON.
– If you are developing on your local system the access your phpmyadmin and login there. If you are able to login means database server is ON. If not then start the MySQL
– Now check dabase name, and login credentials you used to login to phpmyadmin with code present in wp-config.php file present in below image. If not correct then correct them.
Screen Shot 2015-04-05 at 12.37.32 am
After above steps your are done and in 90% cases database connection error would resolve.

Now let us see the rest 10% cases. In such cases you can see on you website’s front-end and back-end you are getting two different messages related to database connection failure. To resolve this follow the above mentioned steps and after that write the below code in wp-config.php file and save it.

define('WP_ALLOW_REPAIR', true);

Once done visit this url: http://www.YOURSITEDOMAIN.com/wp-admin/maint/repair.php
wpdbrepair
This page will allow you to repair your database without login. Yes, you read correctly, without login. That is why be remember to remove te above code from wp-config.php file once database repair done. To repair your database click on ‘Repair Database’. It may take few minutes depending upon the databse size. After that you are done and you must able to access your website.

Leave a Reply

Your email address will not be published. Required fields are marked *