Title: Error establishing a database connection
Last modified: July 10, 2019

---

# Error establishing a database connection

 *  Resolved [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/)
 * hello,
 * I am having major issues after running WP-Optimize plugin . My site [https://www.shopstores.co.uk](https://www.shopstores.co.uk)
   now says Error establishing a database connection.
 * i am also unable to log into my admin
 * Please advise ?
    -  This topic was modified 7 years ago by [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/).
 * 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-900%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11717920)
 * Hello,
 * Which optimizations did you run? WP-Optimize shouldn’t perform any risky actions,
   at least nothing that would cause this type of error.
 * Do you have access to some PHP error logs, to see if anything else happened?
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11718039)
 * Hi,
 * I just ran the standard ones that we’re in the list and already highlighted as
   such.
 * unfortunately I don’t have access to PHP error logs. I will ask AWS (my host)
   to see if they can help out.
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11718055)
 * would removing the plugin through an ftp client help re-accessing my site and
   admin ?
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11718120)
 * I would try renaming the “plugins” directory to something else via FTP, which
   will deactivate all plugins. If this works, you can then rename it back to “plugins”
   and reactivate the plugins one by one.
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11718490)
 * ok. thanks will give that a go
 *  [paulkyte](https://wordpress.org/support/users/paulkyte/)
 * (@paulkyte)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11718999)
 * Hi Balvinder,
 * Do you have a backup of the wp-config.php file taken before you ran the optimisation?
   
   If you do, upload it via FTP and see if you can login then.
 * When you are logged in you could then upload a backup of your database if you
   have one.
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11719392)
 * Changed the name of plugin folder but still not giving me access.
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11719443)
 * uploaded the backed up wp-config file but still no access.
 * any other ideas ?
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11720719)
 * If you have access to the database, via phpMyAdmin or adminer, you should check
   that the credentials you have in wp-config still give you access, and take a 
   look at the database.
 *  Thread Starter [Balvinder Bolla](https://wordpress.org/support/users/ballybolla/)
 * (@ballybolla)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11720878)
 * will do thanks
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11725748)
 * Hi [@ballybolla](https://wordpress.org/support/users/ballybolla/),
 * I see that your website is back up. Did you find the issue?
 * If it was related to WPO, I would be keen to know what happened.

Viewing 11 replies - 1 through 11 (of 11 total)

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

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 11 replies
 * 3 participants
 * Last reply from: [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-900/#post-11725748)
 * Status: resolved