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 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.
Nick-B
November 1, 2024, 1:30pm
2
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:
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
[06 AM]
2. Anti-Virus/Internet Security
Avira
See 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”
[Step%201]
Go …
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
Nick-B
November 5, 2024, 2:13pm
4
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
Nick-B
November 5, 2024, 2:46pm
6
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.
Nick-B
November 5, 2024, 3:45pm
8
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.
Nick-B
November 10, 2024, 2:49pm
10
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.
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.
1 Like
Nick-B
November 20, 2024, 2:23pm
12
Thank you for sharing @buzztone !
system
Closed
February 18, 2025, 2:23pm
13
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.