# Error establishing database

**URL:** <https://community.localwp.com/t/error-establishing-database/41402>\
**Category:** Support\
**Created:** [February 16, 2024, 1:13pm UTC](https://community.localwp.com/t/error-establishing-database/41402 "2024-02-16T13:13:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![minglis](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@minglis](https://community.localwp.com/u/minglis)\
**Post date:** [February 16, 2024, 1:13pm UTC](https://community.localwp.com/t/error-establishing-database/41402/1 "2024-02-16T13:13:33Z")

</div>

### What issue or error are you experiencing?

‘Error establishing a database connection’

I have downloaded the public\_html folder from a live site hosted by siteground in a zip. That site has a custom api integration with a third party application.

I then used that zip to setup a new site. I set custom settings in local wp to match the live site.

The site hung on ‘setting up site’ or something for an hour or so. I restarted local wp, run the site. Then I get the error message.

I noticed the local database was empty when I opened ‘adminer’. I thought I could resolve it by importing the database sql file I then changed the database name to local in wp-config. The import was a success. However, I still get the same error message.

* * *

### What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

 ![config](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/4/1/4178e1e385d3bed3eb25d334bea79f2fac34b88f.png)  
 ![database](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/a/3/a369fdb73feb5c5ceffa4996260b1018c894f3ca.png)  
 ![error](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/e/6/e620f620bec949e6b1f759f54b9c813582b54110.png)  
 ![server](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/7/9/79f6fb52a44d073d460dd8e3d66b926ded524a05.png)

* * *

### System Details

- **Local Version:**  
8.2.1

- **Operating System (OS) and OS version:**  
Windows 10

* * *

### Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))

[local-lightning.log](https://community.localwp.com/uploads/short-url/1CDpQJGUImdLmJQHZzSbQ2wWNov.log) (188.4 KB)

* * *

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [February 16, 2024, 2:09pm UTC](https://community.localwp.com/t/error-establishing-database/41402/2 "2024-02-16T14:09:48Z")

</div>

Hi @minglis

Do you have any antivirus, security, or firewall applications that could be blocking Local? It looks like from the log it might be having trouble connecting.

More details about troubleshooting this here: [Router Mode](https://localwp.com/help-docs/advanced/router-mode/)

Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.

---

<div class="post-metadata">

**Author:** ![minglis](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@minglis](https://community.localwp.com/u/minglis)\
**Post date:** [February 16, 2024, 2:10pm UTC](https://community.localwp.com/t/error-establishing-database/41402/3 "2024-02-16T14:10:26Z")

</div>

We do have a few strict IT policies, I will check that out.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [February 16, 2024, 2:22pm UTC](https://community.localwp.com/t/error-establishing-database/41402/4 "2024-02-16T14:22:08Z")

</div>

If your IT department needs to know what domains or ports Local makes use of this comment and help doc should provide some detail:

> [@Unable to re-connect to WP Engine](https://community.localwp.com/t/unable-to-re-connect-to-wp-engine/36758/6):
>
> Ah nice! We probably should put together a more formal doc of all the remote URLs that Local reaches out to for situations like this. I think these are the main urls that you’d want to whitelist, but I’d be curious if I missed something: [https://hub.localwp.com](https://hub.localwp.com) Connects the Local Desktop app to the Local Web account. Certain Web-focused features require Local Web to do things on the Desktop app’s behalf. For example, the Backups Addon or Live Links feature. [https://api.wpengineapi.com/](https://api.wpengineapi.com/) T…

> **[What is Router Mode?](https://localwp.com/help-docs/advanced/router-mode/)**
>
> Router Mode is Local’s way of offering the best offline development experience possible while still “playing nice” with other, similar development applications.

---

<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:** [May 16, 2024, 2:23pm UTC](https://community.localwp.com/t/error-establishing-database/41402/5 "2024-05-16T14:23:03Z")

</div>

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