What Happened
I’ve been using Local by Flywheel for a long time with 29+ WordPress sites, all stored on a separate drive (F:\Webserver\Source). One day I opened Local and every single site failed to start with the same error:
Uh-oh! Unable to start site.
Error: Command failed: mysqladmin.exe --host=::1 ping
mysqladmin: connect to server at '::1' failed
error: 'Can't connect to MySQL server on '::1' (10061)'
No Windows updates. No new software installed. No disk cleanup tools run. It just stopped working overnight.
Root Cause #1: Duplicate Ports in sites.json (MySQL Crash)
After digging into the log file at:
C:\Users\<username>\AppData\Roaming\Local\local-lightning.log
I found this critical error:
mysqld got exception 0x80000003
InnoDB: trx_undo_mem_init() assertion failed
Tracing back further, I found that one site (code-wp.com) had all services assigned to the same port (10774) in sites.json:
json
"mailpit": { "WEB": [10774], "SMTP": [10774] },
"mysql": { "MYSQL": [10774] },
"php": { "cgi": [10774] },
"nginx": { "HTTP": [10101] }
This appears to have happened when Local crashed or was force-closed during site creation. The corrupted config caused MySQL to crash on startup — taking down ALL other sites with it, not just the affected one.
Fix: Manually edit sites.json and assign unique ports to each service for the broken site.
Root Cause #2: Database Stored in AppData — Easy to Lose
This is the bigger concern I want to warn everyone about.
Local stores your live MySQL/MariaDB database in:
C:\Users\<username>\AppData\Roaming\Local\run\<random-id>\
Each site gets a randomly named folder (e.g., 7ZNeuG4WA, dS7Q-owea). Out of my 29 sites, only 7 had folders in the run directory. The rest were simply gone — likely cleaned up at some point either by Local itself or another process.
The app\sql\local.sql files in your site’s source folder? Those are just the default WordPress install SQL, not your actual current data. Don’t rely on them as backups.
This means:
-
Your WordPress files (themes, plugins, uploads) are safe if stored on a separate drive
-
Your database — posts, orders, settings, users — can be silently lost
What Local Does NOT Do by Default
-
No automatic database backup on shutdown -
No warning when runfolder is missing for a site -
No alert when ports conflict in sites.json -
Database stored in AppData, a location commonly targeted by cleanup tools
How to Protect Yourself
1. Export your sites regularly Use Local’s built-in export: click ... next to the site name → Export. This creates a proper .zip with both files and database. Store it on a separate drive.
2. Install UpdraftPlus or All-in-One WP Migration on every important site Set up automatic backups to Google Drive or a local folder outside AppData. This is the most reliable safety net.
3. Exclude Local’s data folder from any cleanup tools If you use CCleaner, IObit, or similar tools, whitelist:
C:\Users\<username>\AppData\Roaming\Local\
4. Manually backup the run folder periodically Just copy the entire folder to a safe location:
C:\Users\<username>\AppData\Roaming\Local\run\
5. Check your sites.json after any crash If Local crashes or freezes during site creation, open sites.json and verify each site has unique ports for all services.
Feature Requests for the Local Team
If anyone from Local is reading this, here are some suggestions that could prevent data loss for other users:
-
Auto-backup database on site stop — export a
.sqlfile to the site’sapp/sql/folder every time a site is stopped cleanly -
Detect and warn about port conflicts in
sites.jsonbefore attempting to start -
Move database storage out of
AppData\Roamingto a more stable location, or at least allow users to configure where DB data is stored -
Show a warning when a site’s
runfolder is missing on startup
My Setup (for context)
-
OS: Windows 11 Pro
-
Local version: 10.0.0+6907
-
Sites: 29 sites across MySQL 8.0.16, MySQL 8.0.35, MariaDB 10.4.x
-
Source files stored on:
F:\Webserver\Source\
Hope this helps someone avoid the same situation. Always keep external backups — don’t trust any local dev tool to protect your data by itself.