【问题标题】:Everything was working fine but now mysql contaner stop laoding一切正常,但现在 mysql 容器停止加载
【发布时间】:2022-07-25 15:12:14
【问题描述】:

MySQL 容器停止工作并出现以下错误

2022-07-25 05:49:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1.el7 started.


2022-07-25 05:49:29+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.65FVzPwuJc

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:30+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.ajfFuCwWO2

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:31+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.r2VhkPXFTo

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:32+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.WQtqKImJb9

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:33+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.g3TwpP1UTD

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:35+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.bYM72tNNGe

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:39+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.mKxwQLM0KK

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:46+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.Yr61rYdopx

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:49:59+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.lS7uWfBwrF

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:50:26+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.qYyq42iXh7

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:51:17+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.4NqYMZzuCl

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:52:18+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.yO8qi4Zw29

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:53:18+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.EXAH4JSjZh

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:54:19+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.QoawKu8pPd

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:55:20+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.7mtfUsLfIz

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:56:20+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.0UATJ0X9uS

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:57:21+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.boQ221TODc

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:58:21+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.iu5S6zgQfN

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

2022-07-25 05:59:22+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.bhq2Crwhnp

mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)

mysqld: [ERROR] Fatal error in defaults handling. Program aborted!


2022-07-25 05:59:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1.el7 started.

【问题讨论】:

    标签: mysql docker docker-compose


    【解决方案1】:
    mysql:
        container_name: docker.mysql57.internal
        image: mysql:5.7
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: '*****'
        ports:
          - '3306:3306'
        expose:
          - '3306'
        volumes:
          - ~/code/docker-development/logs/mysql:/var/log/mysql
          - **~/code/docker-development/mysql/config:/etc/mysql**
    

    将粗线替换为

          - **~/code/docker-development/mysql/config:/etc/mysql/conf.d/**
    

    接着是 docker-compose up

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-21
      • 1970-01-01
      • 2020-11-08
      • 2011-04-07
      • 2012-02-21
      • 1970-01-01
      相关资源
      最近更新 更多