MySQL fails to bind socket - Unable to provision any site

Bug Summary

Fresh install of local. After first run and rebooting computer. Local can no longer provision any sites due to a MySQL socket binding error. Seems to be permission-related.

Steps to reproduce

  1. Install local.
  2. Create a new site.
  3. Fail to provision any kind of site.

Environment Info

  • Windows 10 Home edition, Version 21H2 (OS Version 22000.184)
  • Local Version 6.1.2+5473
  • Any site software results in the same error.

Supporting info

local-lightning.log (29.2 KB)

For some reason it seems like local tries to place data in the appdata folder of another user of the OS (Ik Ad****rd). The user producing the above logs has username “localdeveloper”.

Hello, I had a similar problem, couldn’t start the site at all.
I know this is not the same problem as yours but might be worth a look.

I was digging through the local-lightning.log and found this error message always shows up:

ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Only one usage of each socket address (protocol/network address/port) is normally permitted.","process":"mysql","thread":"main","timestamp":"2025-03-19T07:31:57.949Z"}

For me the solution was to check the sites.json configuration file and check the port bindings.

You can find it in C:\Users\%USERNAME%\AppData\Roaming\Local\sites.json

Make sure no port binding is the same, otherwise you will get conflicts. Every port should be a different number, like in this example snippet:

"ports":
{"WEB":[10124],"SMTP":[10125]}},"php":
{"name":"php","version":"8.2.23","type":"lightning","role":"php","ports":{"cgi":[10126]}},"mysql":
{"name":"mysql","version":"8.0.35","type":"lightning","role":"db","ports":{"MYSQL":[10127]}}

Thank you for sharing @kresob!

As a temporary workaround changing your Router Mode can sometimes help get around port conflicts. More on this here:

More on Windows and permission issues here:

Closing this out for now since the original post is older, but anyone with continuing issues can always great a new post! :green_heart: