Unable to start site: Connection to MySQL server failed

What issue or error are you experiencing?

Getting an error when starting up a site (that I previously created). Log line is attached below.


System Details

  • Local Version: Version 9.1.0+6719

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


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

{"class":"SiteProcessManagerService","level":"error","message":"Unable to start site.","stack":"Error: Command failed: %%userDataPath%%\\lightning-services\\mariadb-10.4.32+0\\bin\\win32\\bin\\mysqladmin.exe ping\n\u0007%%userDataPath%%\\lightning-services\\mariadb-10.4.32+0\\bin\\win32\\bin\\mysqladmin.exe: connect to server at '127.0.0.1' failed\r\nerror: 'Can't connect to MySQL server on '127.0.0.1' (10061)'\r\nCheck that mysqld is running and that the socket: 'MySQL' exists!\r\n\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:517:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at maybeClose (node:internal/child_process:1098:16)\n    at ChildProcess._handle.onexit (node:internal/child_process:303:5)","thread":"main","timestamp":"2024-10-03T17:23:02.605Z"}

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.

Hey @Braunson

Can you try changing you Router Mode and see if that works?

Preferences>Advanced>Router Mode

Same issue after switching routing mode from site to localhost.

Not sure if this helps but I can start/stop other sites without issue.

You might try reimporting the site having problems then to see if that fixes the issue.

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

That worked, however now the host is localhost:10011 not somesite.local (like it prompted me)?

You’ll have to change your Router Mode back to Site Domains if you want to go back to a domain name that you can see/edit or to use HTTPS.

Ahh yeah :man_facepalming: thanks.

1 Like

Are you all set now @Braunson?

Yep, all set!

1 Like