[root@localhost ~]# docker logs -f 55cca96ac3b6
2022-12-08 08:27:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.40-1.el7 started.
2022-12-08 08:27:23+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.hnyuqI5Yb9
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-12-08 08:28:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.40-1.el7 started.
2022-12-08 08:28:21+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.cvzSVsrxAb
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!
查看容器的启动日志也可以用这个(如上):
docker logs 55
docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
--network=centosnetwork \
-d mysql:5.7.34
删除无法使用的镜像
docker rmi image_id
docker tag 09 mysql:5.7
docker images
docker rmi mysql:5.7.34
docker images
查看运行的容器
docker ps
参考:https://www.pudn.com/news/62fbb6d8f97302478e629aa6.html