服务内部错误: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
然后启动就会一直异常
进入 容器
列表,找到 MySQL 容器,贴一下全部的日志信息。
我的v2版本创建mysql也是报错这个
2025-06-06T09:11:41.970174Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2025-06-06T09:11:42.226263Z 6 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ‘‘mysql_native_password’ is deprecated and will be removed in a future release. Please use caching_sha2_password instead’
2025-06-06 17:11:50+08:00 [Note] [Entrypoint]: Database files initialized
2025-06-06 17:11:50+08:00 [Note] [Entrypoint]: Starting temporary server
2025-06-06T09:11:50.670780Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.
2025-06-06T09:11:50.670793Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.42) starting as process 125
2025-06-06T09:11:50.687700Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-06-06T09:11:50.900399Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-06-06T09:11:51.137800Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2025-06-06T09:11:51.137820Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2025-06-06T09:11:51.153344Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.42’ socket: ‘/var/lib/mysql/mysql.sock’ port: 0 MySQL Community Server - GPL.
2025-06-06T09:11:51.153352Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2025-06-06 17:11:51+08:00 [Note] [Entrypoint]: Temporary server started.
2025-06-06T09:11:51.178050Z 8 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ‘‘mysql_native_password’ is deprecated and will be removed in a future release. Please use caching_sha2_password instead’
Warning: Unable to load ‘/usr/share/zoneinfo/iso3166.tab’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/leap-seconds.list’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/leapseconds’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/tzdata.zi’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/zone.tab’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/zone1970.tab’ as time zone. Skipping it.
2025-06-06 17:11:51+08:00 [Note] [Entrypoint]: Stopping temporary server
2025-06-06T09:11:51.987800Z 10 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.42).
2025-06-06T09:11:54.513605Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL.
2025-06-06 17:11:54+08:00 [Note] [Entrypoint]: Temporary server stopped
2025-06-06 17:11:54+08:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2025-06-06T09:11:55.172859Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.
2025-06-06T09:11:55.172878Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.42) starting as process 1
2025-06-06T09:11:55.188922Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-06-06T09:11:55.406274Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-06-06T09:11:55.609077Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2025-06-06T09:11:55.609142Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2025-06-06T09:11:55.623205Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/run/mysqld/mysqlx.sock
2025-06-06T09:11:55.623226Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.42’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MySQL Community Server - GPL.