Pol*_*lex 11 mysql laravel docker
我正在使用 laravel sail 在我的本地计算机 (macOS) 上启动一个静态网站。所有软件包都是最新的并且可以正确启动,但是,mysql 服务启动,然后由于“pid 62 的另一个进程正在使用 unix 套接字文件”而失败。
我正在使用默认的 sail docker-compose 文件,未经编辑。它在我的另一台 Linux 机器上正常工作,没有任何问题。当访问本地主机时,我遇到了“SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Name or service notknown”,这让我认为它正在以某种方式连接,就像我通常期望的连接被拒绝一样?
以下是 docker mysql 容器日志:
[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
[Entrypoint] Starting MySQL 8.0.32-1.2.11-server
2023-01-26T21:17:04.876429Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-01-26T21:17:04.878708Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-01-26T21:17:04.885183Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-01-26T21:17:05.037353Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-01-26T21:17:05.189336Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-01-26T21:17:05.189362Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-01-26T21:17:05.189506Z 0 [ERROR] [MY-010259] [Server] Another process with pid 62 is using unix socket file.
2023-01-26T21:17:05.189518Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2023-01-26T21:17:05.189521Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-01-26T21:17:06.724573Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
Run Code Online (Sandbox Code Playgroud)
提前致谢。
小智 28
对我有用的解决方案是 - 答案(复制如下)
Laravel Sail Mysql 8.0 现有项目上的问题
通过执行以下命令解决了这个问题:
docker-compose down --volumes
sail up --build
Run Code Online (Sandbox Code Playgroud)
小智 5
我通过打开 Docker 桌面 GUI,打开卷侧边栏来解决我的问题(WSL2、Docker 桌面)。搜索名称中包含“mysql”的所有卷并删除这些卷。然后再跑docker compose up。
| 归档时间: |
|
| 查看次数: |
7207 次 |
| 最近记录: |