MySQL downloads every time I start a site

What issue or error are you experiencing?

MySQL downloads every time I start a site. Site fails to start, then on second attempt it starts.

There is a separate error relating to a Microsoft Visual C++ redistributable that is unrelated

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


System Details

  • Local Version:

  • Operating System (OS) and OS version:


Local Logs

{"class":"ErrorHandlerService","error":{"name":"MissingRedistError"},"eventId":"9f97a2c40ac84a469992a740c761a1de","info":{},"level":"error","message":"Missing Microsoft Visual C++ 2015-2019 Redistributable.","thread":"main","timestamp":"2024-11-11T16:50:09.692Z"}
{"class":"SiteProvisionerService","level":"error","message":"Unable to swap services site.","stack":"Error: Command failed: %%userDataPath%%\\lightning-services\\mysql-8.0.16+3\\bin\\win64\\bin\\mysqld.exe --defaults-file=C:/Users/Siobhan/AppData/Roaming/Local/run/BCe4eUjsN/conf/mysql/my.cnf --initialize-insecure\n2024-11-11T16:50:10.898857Z 0 [System] [MY-013169] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+3\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) initializing of server in progress as process 4304\r\n2024-11-11T16:50:10.900526Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.\r\n2024-11-11T16:50:10.901888Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.\r\n2024-11-11T16:50:10.901902Z 0 [ERROR] [MY-013236] [Server] Newly created data directory %%userDataPath%%\\run\\BCe4eUjsN\\mysql\\data\\ is unusable. You can safely remove it.\r\n2024-11-11T16:50:10.901967Z 0 [ERROR] [MY-010119] [Server] Aborting\r\n2024-11-11T16:50:10.902286Z 0 [System] [MY-010910] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+3\\bin\\win64\\bin\\mysqld.exe: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL.\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-11-11T16:50:10.912Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:16.806618Z 0 [System] [MY-010116] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+3\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 20036","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.791Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:16.808530Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.792Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:20.736312Z 0 [System] [MY-010229] [Server] Starting crash recovery...","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.792Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:20.745201Z 0 [System] [MY-010232] [Server] Crash recovery finished.","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.792Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:21.710814Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.792Z"}
{"class":"Process","level":"warn","message":"2024-11-11T16:50:21.792010Z 0 [System] [MY-010931] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+3\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10017  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-11-11T16:50:21.793Z"}

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

We would be happy to assist with your Local troubleshooting! Could you provide some more details to help us take a further look?

  • What is your OS?

  • What version of Local are you on?

  • Can you also please share a full copy of your logs here? 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. You can drag and drop that zip in your comment to share.

Hey thanks for replying - I still get this issue every time I restart Local. Once it’s up and running it’s fine, but it needs to download MySQL again every time I start the app. Would you know to where these mysql versions are being downloaded?

Windows 10: 10.0.19045
local-logs.zip (1.6 MB)
Local version: Version 9.0.5+6706

Hey @Barrytron

It seems like there are some permission issues and connection problems on your device based on what I’m seeing in the logs.

We have a Windows Troubleshooting guide below that goes over some common items worth checking. For example, make sure you’re running Local as an admin user, that you don’t have any security blockers, and that Local has access to update your Hosts file.

There are also a lot of errors that look like MySQL has extra stuck processes. To check and address this you can open up your Task Manager and kill all of the MySQL processes within, and then try restarting your site.

Hey Nick-B, this issue seems to have resolved with the latest update. Thanks!

1 Like

Glad to hear it @Barrytron! Thank you for letting us know.