执行命令:
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
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/260282.html