# "error establishing database connection"

**URL:** <https://community.localwp.com/t/error-establishing-database-connection/22496>\
**Category:** Support\
**Tags:** mysql\
**Created:** [October 13, 2020, 9:46pm UTC](https://community.localwp.com/t/error-establishing-database-connection/22496 "2020-10-13T21:46:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![caveman75](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@caveman75](https://community.localwp.com/u/caveman75)\
**Post date:** [October 13, 2020, 9:46pm UTC](https://community.localwp.com/t/error-establishing-database-connection/22496/1 "2020-10-13T21:46:39Z")

</div>

I was building a new site on local. tried working on it today and received the “error establishing database” message. The only thing I know is that the power went out for a few seconds, but that has happened a few times this week and never had any issues. I am new at all of this and trying to figure it out, but getting a bit overwhelmed.  
Web server :Nginx  
php version 7.3.5  
database: MYSQL 8.0.16

I will upload both router log and local logs

thank you

[error.log](https://community.localwp.com/uploads/short-url/asx9wzhK0Mxs8XtRMtrdIrZFX9X.log) (323.9 KB)

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [October 14, 2020, 7:09pm UTC](https://community.localwp.com/t/error-establishing-database-connection/22496/2 "2020-10-14T19:09:55Z")

</div>

Hey @caveman75, Welcome to the Local Community Forums!

It’s hard to say why the site went away, but a power outage could definitely cause a corruption within the database.

Can you try restoring the site to a new one in Local? You can use a backup of the site, or try using the files for the site by following the steps outlined in the “Restoring From Only Local Site files” section of this help doc:

- [https://localwp.com/help-docs/how-to-import-a-wordpress-site-into-local/](https://localwp.com/help-docs/how-to-import-a-wordpress-site-into-local/)

If you still have issues, can you please provide your Local Log? See this Community Forum post for instructions on how to do so:

- [How do I retrieve Local’s Log?](https://localwp.com/community/t/how-do-i-retrieve-locals-log-file/3720)

---

<div class="post-metadata">

**Author:** ![caveman75](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@caveman75](https://community.localwp.com/u/caveman75)\
**Post date:** [October 15, 2020, 12:13am UTC](https://community.localwp.com/t/error-establishing-database-connection/22496/3 "2020-10-15T00:13:12Z")

</div>

Hi Ben thanks for getting back. I figured it out. Not exactly sure but I backed it up on my desktop. Thanks again Jeff

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [October 23, 2020, 3:08pm UTC](https://community.localwp.com/t/error-establishing-database-connection/22496/4 "2020-10-23T15:08:58Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
