docker 启动mysql:5.7报错

docker 启动mysql容器报错

[Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.41-1.el7 started.
2023-04-17 09:41:14+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
        command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.QXg3gZVFVb
        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!

 1、删除存在的 mysql启动配置文件

    sudo find / -name my.cnf   --查找

    rm $(find / -name my.cnf)  --删除

  2、再来一次

docker run -p 3307:3306 --name mysql-master -v /mydata/mysql-master/log:/var/log/mysql -v /mydata/mysql-master/data:/var/lib/mysql -v /mydata/mysql-master/conf:/etc/mysql --privileged=true -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7

  启动成功

 

感谢感谢