gpt4 book ai didi

mysql - gitlab 转轮 : mysqld: Can't read dir of '/etc/mysql/conf.d/'

转载 作者:行者123 更新时间:2023-12-01 05:31:19 25 4
gpt4 key购买 nike

我在 docker 中使用 gitlab runners。

它使用我们自己的 php 镜像和 mysql:5.7 镜像。之前它工作,但现在我们可以在启动 CI 作业时看到这个错误:

Running with gitlab-runner 10.4.0 (857480b6)
on gitlab-runner-2 (00929f5e)
Using Docker executor with image registry.blahblah.work/infra/docker-base/php ...
Starting service mysql:5.7 ...
Pulling docker image mysql:5.7 ...
Using docker image mysql:5.7 ID=sha256:f008d8ff927dc527c5a57251b45cead7c9259c16a6a93c144f397eaafc103d36 for mysql service...
Waiting for services to be up and running...

*** WARNING: Service runner-00929f5e-project-4-concurrent-0-mysql-0 probably didn't start properly.

Error response from daemon: Cannot link to a non running container: /runner-00929f5e-project-4-concurrent-0-mysql-0 AS /runner-00929f5e-project-4-concurrent-0-mysql-0-wait-for-service/runner-00929f5e-project-4-concurrent-0-mysql-0

2018-02-13T08:49:03.752410664Z
2018-02-13T08:49:03.752468595Z ERROR: mysqld failed while attempting to check config
2018-02-13T08:49:03.752476292Z command was: "mysqld --verbose --help"
2018-02-13T08:49:03.752481759Z
2018-02-13T08:49:03.752486693Z mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 13 - Permission denied)
2018-02-13T08:49:03.752491885Z mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

设置变量:

variables:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: password

我应该如何调试和修复这个问题?

最佳答案

你需要更改你的 docker compose 文件,你应该添加 privileged: true 我的看起来像:

  mysql:
build: ./DockerFiles/Mysql
ports:
- ${LOCAL_PHP_IP}:${MYSQL_PORT}:3306
privileged: true
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- /opt/mysql_data:/var/lib/mysql

关于mysql - gitlab 转轮 : mysqld: Can't read dir of '/etc/mysql/conf.d/' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48768828/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com