Title: Error establishing a database connection
Last modified: December 16, 2019

---

# Error establishing a database connection

 *  Resolved [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/)
 * Hi,
 * I am getting this Error message “Error establishing a database connection” when
   I open the site- [http://myconnect.in/myshop/](http://myconnect.in/myshop/) and
   also the [http://myconnect.in/myshop/wp-admin/](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
    Gary
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-establishing-a-database-connection-930%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/page/2/?output_format=md)

 *  [Sumit Singh](https://wordpress.org/support/users/sumitsingh/)
 * (@sumitsingh)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12242894)
 * 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 name
 * Thanks
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12242957)
 * Also, check with your host to make sure the database service is up and running
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12243172)
 * 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 – CORRECT
 * The 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
    Gary
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12243220)
 * Can you access the database via PHPMYADMIN from your hosting control panel?
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12244563)
 * Yes I can access the database via PHPMYADMIN from your hosting control panel.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12244676)
 * 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?
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12244750)
 * 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
 *  [mbain](https://wordpress.org/support/users/markcbain/)
 * (@markcbain)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12246862)
 * 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.
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12248258)
 * 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
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12248265)
 * You *can* change the password for your DB_USER in phpmyadmin
 * [https://synoguide.com/2014/02/20/change-password-sql-database-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/](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/](http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/)
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12248293)
 * 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
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12248327)
 * At this point, I think you really need to get your host involved.
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12250830)
 * 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
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12250868)
 * I’d try that. create a new DB_USER and update wp-config.php
 *  Thread Starter [gary4u](https://wordpress.org/support/users/gary4u/)
 * (@gary4u)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/#post-12250916)
 * Ok will try that.
 * Thanks
 * Gary

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/page/2/?output_format=md)

The topic ‘Error establishing a database connection’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 18 replies
 * 5 participants
 * Last reply from: [gary4u](https://wordpress.org/support/users/gary4u/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-930/page/2/#post-12250990)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
