Unable to import db : Repeated "can't connect..." error

What issue or error are you experiencing?

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

1. Create new Local site :
Multisite: Subdirectories
2. Create db backup from WP Engine
3. Import resulting .sql file to app/public (at C:\Users\Username\Local Sites\site-name\app\public)
4. Use “open site shell” to open wp-cli
5. Use wp-cli command to import db
wp db import mysql.sql
6. Receive error message:
Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
7. Try again, this time stipulating Port listed on Local’s db tab:
wp db import mysql.sql --ssh=10061
8. Receive error
Error: Cannot connect over SSH using provided configuration.

System Details

  • Local Version:
    Version 8.2.0+6554
  • Operating System (OS) and OS version:
    Win 11 Enterprise
    23H2

Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](
(see attached)
local-logs.zip (33.4 KB)

Hi @v-rimiller

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

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

I do sometimes run Docker, however even after stopping all Docker containers this problem persists.
Likewise I do have antivirus and firewall applications running, however other Local sites have been able to run – in fact, the site I’m trying to do the import on is running, it is just currently empty because I can’t import the db – so my question is what should I be looking for in firewall / security settings? What would block an import but not connectivity?

I have tried to specify a port in the import command, using the port shown in the Local database pane like this:
wp db import mysql.sql --ssh=10061

Update: I am having some success using direct mysql commands of this form:
mysql -u root -proot local < database.sql
as shown in this thread:

2 Likes

Glad to hear it @v-rimiller! Thank you for the update.

Update 2: Site is up and running. Consider this thread closed. Thank you!

1 Like

I’m glad to hear it!

I’ll close this out for now but don’t hesitate to come back to us if you have any other questions or concerns. :green_heart: