centos7拉取mysql报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!
此情况针对于linux云服务器拉取mysql镜像启动容器后docker ps -a查看容器状态为exit(0),容器启动异常
一、查看容器日志报错
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=1548447109qQ \
-d mysql:5.7
docker logs -f xx
==>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!
cd /mydata/mysql/conf
mkdir conf.d
mkdir mysql.conf.d
重启docker
systemctl restart docker
重启容器
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=1548447109qQ \
-d mysql:5.7
此时docker ps可以看到容器正常启动
二、linux安装mysql
分版本安装不同mysql 详细见转载==>
https://blog.csdn.net/qq_45441466/article/details/109670194
*systemctl stop mysqld.service
*systemctl start mysqld.service
*systemctl restart mysqld.service
三、连接可视化软件
服务器地址;云服务器操作系统登录账号+登录密码 port:3306
标签:mydata,数据库,navicat,mysqld,conf,mysql,3306,服务器,docker
From: https://www.cnblogs.com/chillymint/p/17274644.html