Can’t connect to MySQL server on ‘localhost’ (10061)

What issue or error are you experiencing?


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

I exigently remove files from folder

AppData\Roaming\Local\run

I think that these are some kind of cache files… but no. I remove the program and install Local but it didn’t help

System Details

  • Local Version: Windows 10

Local Logs

local-lightning.log (387.4 KB)


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.

Is this happening for all of your sites @BlackStar1991? Or just a single site?

Have you tried rebooting your device? Changing your router mode?

For all projects.

I pulled these projects with the database from the server, but it didn’t help.. Also I tried turn on LocalHost →

That didn’t help too.

What about opening Windows Task Manager and killing MySQL? If you do that can you get a site to start after?

I couldn’t find MySQL in the Windows Task Manager, so I completely restarted the system, but that didn’t help.

The problem still remains.

If you create a new, blank site does that start okay? Or do you get the same error?

Are you running any other developer applications simultaneously?

Yes, I created a new WP site using Local, and it works correctly.

No, I don’t use any programs that could conflict with Local.

Are you able to check and see if anything is using that port at all that can be killed?

I don’t understand how this is supposed to help me? I don’t see this PORT here

I was just trying to ensure there weren’t any conflicts there @BlackStar1991

The easiest way to get your sites working again is going to be to reimport them. I know you have quite a lot, but since a new, blank site is working normally you can use these steps to reimport and get them working again:

  • Locate the site files on your machine, and save a copy of them to your desktop. If you click Go to Site Folder under your site name it should take you right to where they are located.
  • Once you have those copied, completely delete the site from Local
  • Reimport the site back into Local. You can refer here on how to Restore from only Local site files

Looking back at your original post, you mentioned deleting the AppData\Roaming\Local\run directory. I may have misunderstood if you deleted those files to try to solve the error, or if the error only occurred after deleting those files (which would be expected). You would have to restore that directory for those sites to run again, or reimport them. If you were seeing the error before deleting that directory, then reimporting would still be the best bet to get things working again.

1 Like

Yes, problems starts after I remove files from AppData\Roaming\Local\run
Yes, restoring from the Servers version helped… but perhaps you have other suggestions? (A lot of projects in local PC)

If you’re still getting the same “Can’t Connect” error on start, then reimporting is going to be the fastest way to get things working again @BlackStar1991

1 Like

This folder contains your database data for each site, not disposable cached data, which is why you see MySQL connection issues when trying to start your sites without it, @BlackStar1991. (It’s not safe just to delete it as you’ve been doing because it removes data your sites need to start.)

If you’re looking for a way to save space from having large numbers of sites, you could use Local’s export feature to ‘archive’ a site as a zip file, then store that somewhere else (those exports contain a database dump) and then delete the site in Local (which will remove the ‘run’ folder for just that site).

When you need to work on the site again, you could reimport it by dragging the zip into Local.

1 Like

Is it possible to restore DataBases from these projects ? *or everything was in this folder

AppData\Roaming\Local\run

@BlackStar1991 If you have a backup of your system, you could find the AppData\Roaming\Local\run folder and restore it.

If you don’t have a system backup, then reimporting your content as @Nick-B described is the next step. This usually restores your site and database files to the state it was at the last time you stopped it.

https://localwp.com/help-docs/getting-started/how-to-import-a-wordpress-site-into-local/#restore-local-site-from-site-files

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