ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
执行命令查看输出log
mysqld --console
D:\Program Files\mysql-8.0.19-winx64>mysqld --console
2020-04-03T03:29:17.907577Z 0 [System] [MY-010116] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) starting as process 4772
2020-04-03T03:29:17.909125Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-04-03T03:29:19.799340Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-03T03:29:19.819720Z 0 [System] [MY-010931] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.19' socket: '' port: 0 MySQL Community Server - GPL.
2020-04-03T03:29:19.822756Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2020-04-03T03:29:19.825137Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-04-03T03:29:19.878167Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2020-04-03T03:29:20.525948Z 0 [System] [MY-010910] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
关键错误
TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
解决方案
修改my.ini
,添加shared-memory