执行命令:
docker run -p 3306:3306 --privileged=true
-v /mysql/data:/var/lib/mysql
-v /mysql/log:/var/log/mysql
-v /mysql/conf:/etc/mysql
-e MYSQL_ROOT_PASSWORD=1234
--name=mysql-server -d mysql:8.0
错误信息:
[ERROR] [Entrypoint]: mysqld failed while attempting to check config command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.6VZosksth2 mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory) mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36. mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
从上面报错信息可以看出 mysqld: Can't read dir of '/etc/mysql/conf.d/' (无法读取/etc/mysql/conf.d/目录)。这样就知道原因了,mysql找不到conf.d目录。所以启动容器时指定到conf.d目录
修改命令:
docker run -p 3306:3306 --privileged=true -v /mysql/data:/var/lib/mysql -v /mysql/log:/var/log/mysql -v /mysql/conf:/etc/mysql/conf.d标签:log,read,etc,报错,conf,mysql,--,mysqld From: https://www.cnblogs.com/mmykdbc/p/17685998.html
-e MYSQL_ROOT_PASSWORD=1234 --name=mysql-server -d mysql:8.0