By Neha Yadav Our Bestseller: WordPress Themes
Hi guys, I am back with the solution of a very common problem but a time consuming and may be sometimes a disastrous problem for all the WordPress users. Yes it often happens that you may get some error message when you are logged out of wp -admin, so here in this article I elaborated an issue along with its solution about how to overcome of this situation, and again get access to your site.
My articles will cover up one by one issues or common error problems with their solutions and I guess maybe you will find your way too.
An error message of “Error Establishing Database Connection” is a common error that is sometimes displayed on your entire site. This error is due to some of the facts like maybe your database got corrupted or may be your connection need to be re-established, or it may be from the side of web hosting server etc. No doubt as a WordPress beginner, this could be awfully frustrating especially when it happened on its own without you changing anything. So now let’s move on to the solution, but before making any changes be sure about your backups.
Step 1: Be clear that are you getting this error on the front end and back end of your site, if it is not so and if you are getting different error like “One or more database tables are unavailable. The database may need to be repaired” then this is the time to repair your database now.
Step 2: You can repair your database by adding the below mentioned line in your wp -config . php file:
define ( 'WP_ALLOW_REPAIR' , true);
After completing this you can view your setting by visiting the page:
http://www.yoursitename.com/wp-admin/maint/repair.php
You will find
The important point that you need to keep in mind is once you are finished with repairing and optimizing your database, make sure to remove this from your wp -config . php .
Step 3: If this not the solution to your error then proceeds to the next step and that is about checking the wp -config file, which is the most important file in your WordPress installation, and the file in which you use to specify the details of your database regarding the connection.
Step 4: First of all open the file and check whether it is the same as it was previously? Because if you change your root password, or the database user password, then you will need to change this file as well.
1 define ( 'DB_NAME' , 'database-name' );2 define ( 'DB_USER' , 'database-username' );
3 define ( 'DB_PASSWORD' , 'database-password' );
4 define ( 'DB_HOST' , ' localhost ' );
Now here some of the people believe that they can fix their problem by replacing localhost with the IP. It is common to see this sort of issue when running WordPress on a local server environment. For example on MAMP, the DB_Host value when changed to the IP may seem to work.
define ( 'DB_HOST' , '114.0.0.1:9989' );
But IP’s vary when you are at online hosting or for web hosting services.
Step 5: If everything till now is correct in this file and still the error exist then you will be fair to say that the error is from server end .
With this I am not going to leave you with your problem, we will move further now to how to Check Your Web Host!!!!!
It is an error you get when you have a great traffic on your site and especially when you are on shared hosting, the only thing you should do is contact with your hosting provider either by phone, live chat through Skype etc , and ask them if your MySQL server is responsive. Also along with these check other sites which are on the same server, are they also getting the same issue if it is so then most sure that it is MySQL server problem. So if you get the access denied error in either connecting to your phpMyAdmin or through testconnection.php results, then you should contact your host right away to get them to fix it.
Hope this article would have helped you to get a a solution for your error. Your comments, queries and suggestions are always welcome !!!!
About Neha Yadav
subscriber
"I like to post the blogs related to real life and helpful for a successful life. You can gain more knowledge and share your issues with me on our website via comments"
Comments and Responses
0 nhận xét:
Đăng nhận xét