# Unable to import SQL db into local WP site

**URL:** <https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322>\
**Category:** Support\
**Created:** [November 1, 2024, 8:54am UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322 "2024-11-01T08:54:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nakshatras](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@Nakshatras](https://community.localwp.com/u/Nakshatras)\
**Post date:** [November 1, 2024, 8:54am UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/1 "2024-11-01T08:54:43Z")

</div>

### What issue or error are you experiencing?

When I tried importing the SQL db to local WP site, I am experiencing the below error:

## C:\Users\DELL\Local Sites\nakshatras\app\public\>wp db import i9057945\_wp1.sql Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

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

* * *

### System Details

- **Local Version:**

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

* * *

### Local Logs

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

* * *

_ **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:** [November 1, 2024, 1:30pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/2 "2024-11-01T13:30:14Z")

</div>

Hi @Nakshatras

Are you on Windows? You might need to check you are running the application as an administrator and nothing is blocking the Local app.

Here are some good places to start:

> [@Help! I'm running into an EPERM error with the hosts file on Windows](https://community.localwp.com/t/help-im-running-into-an-eperm-error-with-the-hosts-file-on-windows/3508):
>
> This is usually caused by the hosts file being set to read-only or locked by anti-virus. 1. Remove Read-only Attribute Go to C:\Windows\System32\drivers\etc Right-click on the hosts file and go to “Properties” Uncheck “Read-only” Click “Apply” Re-open Local Screenshot 2. Anti-Virus/Internet Security Avira See [https://answers.avira.com/en/question/avira-blocks-hosts-file-what-can-i-do-90](https://answers.avira.com/en/question/avira-blocks-hosts-file-what-can-i-do-90)Kaspersky Total Security Open Kaspsersky Total Security Go to “More Tools” Go …

---

<div class="post-metadata">

**Author:** ![Nakshatras](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@Nakshatras](https://community.localwp.com/u/Nakshatras)\
**Post date:** [November 5, 2024, 2:06pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/3 "2024-11-05T14:06:16Z")

</div>

Hi Nick,

I tried running the local WP as administrator but still find the below error message. Please advise on how to proceed further.

 ![image.png](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/f/3/f3fcf0e0b009eb798fa198657ed9069f1ae7b0d5.png)

Regards  
Selva

---

<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:** [November 5, 2024, 2:13pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/4 "2024-11-05T14:13:30Z")

</div>

It seems like something is still blocking connections for you here @Nakshatras

Do you have any antivirus, security, or firewall applications that could be blocking Local?

Are you running other developer applications simultaneously? Apps like MAMP, XAMPP, or Docker for example.

---

<div class="post-metadata">

**Author:** ![Nakshatras](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@Nakshatras](https://community.localwp.com/u/Nakshatras)\
**Post date:** [November 5, 2024, 2:35pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/5 "2024-11-05T14:35:18Z")

</div>

Nope, Nick. This is my personal laptop and I don’t have any antivirus or security software. I tried importing the site automatically and everything went smooth importing all the files. Unfortunately, it ended up with the below message and the entire site database got deleted automatically. Please advise.

 ![image.png](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/1/6/161dc0122fb1bf47c1baebf4c6acaf69bd903b01.png)

RegardsSelva

---

<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:** [November 5, 2024, 2:46pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/6 "2024-11-05T14:46:13Z")

</div>

Are you able to create a new, blank site in Local and access that okay?

---

<div class="post-metadata">

**Author:** ![Nakshatras](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@Nakshatras](https://community.localwp.com/u/Nakshatras)\
**Post date:** [November 5, 2024, 3:30pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/7 "2024-11-05T15:30:58Z")

</div>

Yes, Nick. I even imported the complete package but finally ended up with the error message I forwarded to you earlier.

---

<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:** [November 5, 2024, 3:45pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/8 "2024-11-05T15:45:47Z")

</div>

Okay then there might be an issue with the database you’re trying to import.

Does the site have anything unique about it’s configuration? What were the original WP/PHP/server type and database on the original site?

Is the DB overly large? Does it have any tables with a lot of bloat, like millions of rows?

Was the original site a multisite?

---

<div class="post-metadata">

**Author:** ![Nakshatras](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@Nakshatras](https://community.localwp.com/u/Nakshatras)\
**Post date:** [November 6, 2024, 6:30am UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/9 "2024-11-06T06:30:26Z")

</div>

Hi Nick,

Please find my comments below for your kind review. Kindly advise on how to proceed further.

Does the site have anything unique about it’s configuration? What were the original WP/PHP/server type and database on the original site?

**Linux based server and SQL database**

Is the DB overly large? Does it have any tables with a lot of bloat, like millions of rows?

**2.6 GB. It doesn’t have tables but has a lot of images and text as it is an affiliate marketing website.**

Was the original site a multisite?

**The domain is one but it has 10 webpages based on the categories.**

---

<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:** [November 10, 2024, 2:49pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/10 "2024-11-10T14:49:36Z")

</div>

2.6 GB is quite large for a database. I’ve definitely seen larger, but it’s possible that the import is timing out because of the size.

You also mentioned it’s an affiliate marketing website. Does it use Affiliate WP by chance? This plugin can sometimes cause DB errors.

---

<div class="post-metadata">

**Author:** ![buzztone](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/buzztone/32/5071_2.png) [@buzztone](https://community.localwp.com/u/buzztone)\
**Post date:** [November 20, 2024, 7:13am UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/11 "2024-11-20T07:13:49Z")

</div>

Hi Nakshatras,

I had exactly the same error on Windows 11 with .sql file size of 473 MB. I solved the problem using this earlier solution.

> [@Unable to access database](https://community.localwp.com/t/unable-to-access-database/14465/13):
>
> Hey Everyone – We’ve been zeroing in on why this is happening and the general issue is that the wp db subcommands use the --no-defaults param which blocks out the custom MySQL config we provide. There is a solution but we ran into major issues when trying to implement it on Windows so we’re still working on a way to implement this in a way that works across the various environments. In terms of a workaround, as @kristarella mentioned, you should be able to do some of the basic things wit…

_NOTE: The import in my case took a couple of minutes to run._

---

<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:** [November 20, 2024, 2:23pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/12 "2024-11-20T14:23:16Z")

</div>

Thank you for sharing @buzztone!

---

<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:** [February 18, 2025, 2:23pm UTC](https://community.localwp.com/t/unable-to-import-sql-db-into-local-wp-site/45322/13 "2025-02-18T14:23:58Z")

</div>

Closed on February 18, 2025, 2:23pm UTC

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