Can't connect to MySQL server on 'localhost' (10061)

What issue or error are you experiencing?

So I’ve followed the guide for transferring over a WordPress website. I got the point of transferring the database over.

I’ve entered in the command wp db import yasexpdbvv.sql, but it comes back with an error message:

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

I’ve simply created a new site on WP Local, transferred over wp-content, and then attempted to install the database. I followed this guide:


System Details

  • Local Version:

  • Operating System (OS) and OS version:
    Microsoft Windows 10 Pro


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 @peach121

There might be something blocking Local here. Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.

Do you have any antivirus, security, or firewall applications that could be blocking Local? It looks like from the log it might be having trouble connecting.

More details about troubleshooting this here: Router Mode

Hi @Nick-B

Thanks for the response. No, I don’t have any other applications running like that. I did find a thread that said there seemed to be an issue with Windows, and it is best to run command mysql -u root -proot local < yasexpdbvv.sql.

However, it then comes back with a new error ERROR 2006 (HY000): MySQL server has gone away

It seems like there might be some kind of issue with the database. Where is this site coming from? Does it have any unique configurations?