Error establishing a database connection
-
Hi,
I am getting this Error message “Error establishing a database connection” when I open the site- http://myconnect.in/myshop/ and also the http://myconnect.in/myshop/wp-admin/ . I have checked the WP trouble shooting but still no result. Can anyone please let me know how to the website function.
Thanks
GaryThe page I need help with: [log in to see the link]
-
Hi,
Please check the below-defined value set properly in the wp-config.php file.
define(‘DB_NAME’, ‘database-name’); – Your database name
define(‘DB_USER’, ‘database-username’); – Your database User name
define(‘DB_PASSWORD’, ‘database-password’); – Your database password
define(‘DB_HOST’, ‘localhost’); – host nameThanks
Also, check with your host to make sure the database service is up and running
Hi,
Thank you for your response. first I have checked with the server guys and they have said all is fine at their end. So I checked the wp-config.php this also looks to be fine.
Have checked these :
define(‘DB_NAME’, ‘database-name’); – Your database name – CORRECT
define(‘DB_USER’, ‘database-username’); – Your database User name – CORRECT
define(‘DB_PASSWORD’, ‘database-password’); – Your database password – CORRECT
define(‘DB_HOST’, ‘localhost’); – host name – CORRECTThe username looks alright , so I have tried to change the database password in the Database – change password. This also has been no use , it shows Error.[ lOOKS LIKE I CANNOT CHANGE THE DATABASE PASSWORD]
I have also removed all history and cookies etc but no use.
Even I have entered this – define(‘WP_ALLOW_REPAIR’, true); in the wp-config.php this also does work.
Even the main site does not open have tried also opening other files from the website but this is also does not work.
Please help me on this.
Thanks
GaryCan you access the database via PHPMYADMIN from your hosting control panel?
Yes I can access the database via PHPMYADMIN from your hosting control panel.
OK, good.
So, one of the constants in wp-config.php is wrong. I am assuming that the site did work and stopped, so what else happened just before it stopped working?
Honestly no idea. But I started getting this messages before that “your IPS address is attacked” , I have taken a screen shot , I contacted the Server company about this and they have said that they have no issues , and then I contacted the Antivirus company[ Kaspersky ] they to have said all is fine and told me to have a good day. Now I am stuck with this. Best part is that this happens[Error establishing a database connection] only when I try opening these sites which I mentioned earlier.
But what I am not able to understand why I cannot change the Database password in – PHPMYADMIN
I dont know what else to try.
Gary
Your hosting company should be able to help you reset your database password. Usually you can do this yourself via cPanel or whatever panel they use. I don’t think you can do it via phpmyadmin.
Hi,
Thank you for your response. Yes sorry one cannot change the password in phpmyadmin. It can be done in Cpanel. But is showing Error when I do. I can change my other databases passwords but not this one . Not sure why , I have checked with my server guys they said that there is nothing wrong at they end and I should check at my side.
I am using Astra theme for this project. It is a eCommerce , woo-commerce and with instamojo. Can it be any of the plugins that can be causing the problem not sure. To check I first need to login to the dashboard which I am unable to.
Like I said I did try to change the password in the Cpanel Database but it is showing Error. Do I need to uninstall the complete WP and reinstall.?
The site was working fine and all of a sudden it just got cut off with -” Error establishing a database connection “. Not able to see the main site and the login page itself.
Please let me know.
Thanks
Gary
You *can* change the password for your DB_USER in phpmyadmin
https://synoguide.com/2014/02/20/change-password-sql-database-phpmyadmin/
This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.
If you can install plugins, install “Health Check”: https://wordpress.org/plugins/health-check/ On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site. You can then use its admin bar menu to turn on/off plugins and themes one at a time.
See http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/
Set MySQL User Password
The request failed. (Error ID kak69e)This the message I am getting when I try to change the password. What should I do now.
Gary
At this point, I think you really need to get your host involved.
This is the reply I got from the Server guys.
[Hi,
You can simply delete the mysql user and recreate / Else delete and recreate with alternate name on your cPanel and update the same on your configuration file .
And this will resolve your issue.
If Still you facing any issue on specific path, Please do reply us to restore the backup from the last available backup .]After this email response form the server guys they have closed the issue.
So should I go with this or is there any other way to resolve the issue.
Please let me know.
Gary
I’d try that. create a new DB_USER and update wp-config.php
Ok will try that.
Thanks
Gary
The topic ‘Error establishing a database connection’ is closed to new replies.