首页 > 数据库 >docker启动mysql报错Can't read dir of '/etc/mysql/conf.d/'

docker启动mysql报错Can't read dir of '/etc/mysql/conf.d/'

时间:2023-03-02 09:56:56浏览次数:36  
标签:log read etc 报错 conf mysql -- mysqld

执行命令:

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=1234qwer
--name=mysql-server -d mysql:8.0.32

 

错误信息:

2023-03-02 01:34:04+00:00 [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 
-e MYSQL_ROOT_PASSWORD=1234qwer --name=mysql-server -d mysql:8.0.32

 

标签:log,read,etc,报错,conf,mysql,--,mysqld
From: https://www.cnblogs.com/eternality/p/17170773.html

相关文章