Unable to import SQL db into local WP site

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)


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.

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:

Hi Nick,

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

Regards
Selva

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.

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.

RegardsSelva

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

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

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?

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.

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.

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.

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

1 Like

Thank you for sharing @buzztone!

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