[Solved] ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)

Updated: 23th March 2025
Tags: mysql windows

Sometimes if you force restart Windows mysql 8 doesn’t work. Probably because some tables were opened or whatever.

To solve this navigate to Data Folder. Usually, it is in C:\Program Files\MySQL\MySQL Server 8.0\data, but you may be configured somewhere else, so go there.

  1. Go to the data folder. On Windows default is C:\Program Files\MySQL\MySQL Server 8.0\data.
  2. Find the latest file with extension.err
  3. Open with any text editor like Notepad++.
  4. Go to the end.
  5. Find what was the error about.

Usually, it will have something like this:

2025-03-23T03:12:42.590535Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.28) starting as process 2672
2025-03-23T03:12:42.782810Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-03-23T03:13:14.644421Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2025-03-23T03:13:14.645109Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 821414241 = ['my_database1\run_commands.ibd', 'my_database2\contacts.ibd'] 
2025-03-23T03:13:14.646055Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2025-03-23T03:13:14.647753Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-03-23T03:13:14.649091Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-03-23T03:13:14.649510Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-03-23T03:13:14.654140Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.28)  MySQL Community Server - GPL.
2025-03-23T03:14:51.258301Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future 

So you need to cut the tables (if you don’t need them my_database1\run_commands.ibd, my_database2\contacts.ibd).

After this restart MySQL from services.