Unable to Start Site 'Can't connect to local MySQL server through socket'

What issue or error are you experiencing?

Uh-oh unable to start site popup, full error:
Error: Command failed: /Users//Library/Application Support/Local/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqladmin ping
amysqladmin: connect to server at ‘localhost’ failed
error: 'Can’t connect to local MySQL server through socket '/Users/
/Library/Application Support/Local/run/vC_agctSF/mysql/mysqld.sock’ (61)’
Check that mysqld is running and that the socket: ‘/Users/***/Library/Application Support/Local/run/vC_agctSF/mysql/mysqld.sock’ exists!

at ChildProcess.exithandler (node:child_process:430:12)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1091:16)
at Socket. (node:internal/child_process:449:11)
at Socket.emit (node:events:513:28)
at Socket.emit (node:domain:489:12)
at Pipe. (node:net:322:12)


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

open program, try to start one of my sites, works fine on others


System Details

  • Local Version:
    Version 8.2.1+6583

  • Operating System (OS) and OS version:
    macOS 14.3 (23D56)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-logs2.zip (1.3 MB)


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

If you change your Router Mode to Localhost are you able to proceed? Preferences>Advanced>Router Mode>Localhost

Hi, I literally have this exact same issue and need some help. I just installed Local on my MAC with OS High Sierra 10.13.6. That is the latest version I can use.

Error: Command failed: /Volumes/xxxx/Users/xxxx/Library/Application Support/Local/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqladmin ping
amysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/Volumes/xxxx/Users/xxxx/Library/Application Support/Local/run/S9lZAFtYh/mysql/mysq’ (2)’
Check that mysqld is running and that the socket: ‘/Volumes/xxxx/Users/xxxx/Library/Application Support/Local/run/S9lZAFtYh/mysql/mysqld.sock’ exists!

at ChildProcess.exithandler (node:child_process:430:12)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)

After I click OK, it pops up asking me to allow host redirection on the MAC, which I do, I put my password in for “Local wants to make changes” and click OK. However, when I try again I still get the same error.

I have the same issue. I’ve tried changing it to local host, but the issue persisted. Can anyone assist me with getting this fixed?

Here is a screenshot of the error message:

Hi @Yolandi and @adz

Just an FYI that MacOS 10.13 is not compatible with the latest releases and PHP versions in Local per our minimum requirements.

If you’ve updated your OS and are still running into this problem, check and see if you can create a new, blank site in Local and access that okay. If you can then you may want to try and reimport the site having the problems.

The steps would look like this:

  • 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
  • Restart Local/your machine
  • Reimport the site back into Local. You can refer here on how to Restore from only Local site files

I get the same issue with different sites and it’s so random that I can’t even predict which ones and why. I had 5 site working yesterday that no longer worked today and would throw a bunch of different errors (including the one above). Update the Local to latest version, tried changing route mode as suggested. Only one of sites has launched, another one launched from like a tenth attempt and 3 others are not working. The error shows up 3 times

While some sites have these issues, some other site launch just fine or work after 2 or 3 attempts.

I managed to clone the site and everything is again working as it should. I’m not pushing hard to finish the build before I run into any other weird issues.

2 Likes

Something else you can try to do is stop all sites in Local, quit Local, and then restart your machine and go back in. If that doesn’t clear things up then you can try cloning or reimporting the sites throwing errors to get them working again.

I tried restarting, it helps sometimes. But I have to recreate about 10 sites every single month because of these issues. This is a lot of extra unreasonable work.

Generally, when this happens, it’s because something is interfering with the connection. Possibly something didn’t get fully cut off. Some things you could try:

  • Make sure before quitting Local to stop all your sites.

  • Check to see if you are using any Local add ons. Like Image Optimizer. Sometimes disabling these will help.

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

  • You can try changing your Router Mode to see if that makes a difference as well: Preferences>Advanced>Router Mode

I make sure to stop all the sites before quitting, I don’t use any add-ons and I’m not running any other development tools.
When switched the router mode, none of sites worked at all. I had to switch back and restart computer to make it work again, but half of the sites still had the same mysql error shown above

Hi @rilel

Are you on Windows?

What types of security/antivirus/firewall applications do you have installed?

Does this issue primarily happen after an update of Local? After the update if you downgrade back down does it resolve? Downgrade Local Version - Local

Yes, I am using Windows. I don’t have anything extra installed, only Microsoft Defender. I will need some time to test if downgrading helps. I believe I had different errors here and there, randomly but usually another attempt to start the site helped and now half of them are not working. I will test downgrading and let you know

1 Like

Sounds good @rilel keep us posted :slight_smile:

@Nick-B I have downgraded to the previous version, and then tried with the latest version too. Here are the errors I get when I launch the site. It happened today though the site worked fine on Friday (2 days ago).
These are different errors I got trying to start the site.




Somehow after 5th attempt, the site seem to be started but didn’t load in 5 minutes. I restarted the “Local”, started the site again, got some of these messages, eventually after another attempt the site would seem to be okay as per Local but it doesn’t load at all. I restarted the Local again and now with all the errors, it wouldn’t start the site at all.

I had to create a new version of the site to make it work.
And now I am trying to start another site, and it won’t work with the same error.

Have you tried disabling Windows Defender to see if that makes any difference? Some other things you could check here:

I don’t think Microsoft Defender interferes in any way. Firstly, I don’t get any errors outside of Local folder, nor any notification like the one shown in the link you sent. Secondly, some sites work while others don’t. If it was consistent across all sites, sure, I’d look into it. But not when it’s random sites at random moments. And in most cases recreating the site from scratch helps. So something goes wrong along with pull/pushes. Or some processes don’t get cleaned up properly so that some of the sites start acting up over the time.
And lastly, I can’t disable the only security system I have. I use Local 80% of my time.

It’s tough to narrow down since it’s so random and inconsistent, as you’ve stated, so I’m just trying to help rule some things out.

Do you notice the issues specifically after trying to push or pull since you mentioned those actions?

Are any of these sites overly large? Have lots of media (videos, images, audio, etc)? Have large databases?

Do you notice any performance issues when using Local or a Local site as far as speed?

Do you utilize any of the Local Add Ons?

Can you share a full Local Log here for us to look at? There are some different ways to access and share Local Logs. For us to be able to troubleshoot thoroughly, please click the Download Local Logs button from the Support tab in Local. This will generate a zip archive that contains the Local log along with some other diagnostic information to help quickly zero in on any issues that Local is encountering.

1 Like

Hello Nick,
I’m facing the same issue as Rilel, I’ve 43 websites on local and out of those 10+ are not working and showing different errors.
If you resolve his issue, it will resolve my issue automatically.
Waiting with hope.
Thank you.