Fixing a MySQL connection error in Local by Flywheel on Windows.

What issue or error are you experiencing?

Local by Flywheel fails to provision a new site because it can’t connect to MySQL. The error in the logs is: ERROR 2003 (HY000): Can't connect to MySQL server on '::1:10006' (10013). This happens when Local tries to set up the MySQL user and create the database. The processes start, MySQL reports “ready for connections”, but the connection attempt via IPv6 (::1) fails, so Local kills all processes and deletes the temporary files.

What steps can be taken to replicate the issue?

  1. Open Local by Flywheel.
  2. Click “Add new site” → “Create a new site”.
  3. Enter a site name (e.g., mysite) and continue with default settings (or with MySQL 8.4.0).
  4. Wait for the provisioning process to run.
  5. The setup fails with the MySQL connection error; Local stops all services and removes the temporary run folder.
    I’ve already tried: temporarily disabling Kaspersky Antivirus, and I’m planning to test with an older MySQL version (e.g., 8.0.39) next.

System Details

Local Version: 10.1.2+7004
Operating System (OS) and OS version: Windows 11 Pro, version 10.0.26200 (x64)

Hi @Gleb! We have a Windows Troubleshooting guide below that goes over some common items worth checking. For example, ensure that Local is running as an administrator, that there are no security blockers, and that Local has access to update the Hosts file.