Skip to content

Instantly share code, notes, and snippets.

@8ctopotamus
Last active March 12, 2025 19:11
Show Gist options
  • Save 8ctopotamus/cf3069a8ee076b2c33169b4d42707065 to your computer and use it in GitHub Desktop.
Save 8ctopotamus/cf3069a8ee076b2c33169b4d42707065 to your computer and use it in GitHub Desktop.

Following "manual import" instructions on Windows: https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#Manually-Import-a-Local-site.

I get the error when running wp db import db.sql in LocalWP's site shell:

Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

Use this command instead.

mysql -u root -proot local < db.sql

Source: https://community.localwp.com/t/cant-connect-to-mysql-server-on-localhost-10061/42645/3


Update

The issue is actually with the Windows Command Prompt shell. To change the Default Terminal in local go to Preferences and make sure the default terminal is Git Bash.

Once applied, you can use the wp-cli commands, such as wp db import db.sql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment