在windows 中 docker 中遇到的mysql World-writable config file ‘/etc/mysql/my.cnf‘ is ignored.

[ERROR] [MY-010095] [Server] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files

网上说是MySQL的升级后的安全原因5.xx之后吧,那么你可以降级处理(ps.没操作过)
我的操作方式是直接新建一个目录挂在到/var/lib/mysql-files

user=mysql
character-set-server=utf8
default_authentication_plugin=mysql_native_password
secure_file_priv=/var/lib/mysql
# secure-file-priv=/var/lib/mysql (和上面哪个一样哪个能用用哪个)
expire_logs_days=7
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
max_connections=1000

我的命令

docker run -d --privileged=true -p  13306:3306 --name qqqmysql -v D:\sqldata:/var/lib/mysql -v D:\sqlinfo\conf.d:/etc/mysql/conf.d -v D:\sqlinfo\my.cnf:/etc/mysql/my.cnf -v D:\sqlinfo\mysql-files:/var/lib/mysql-files -e MYSQL_RANDOM_ROOT_PASSWORD=root -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ALLOW_EMPTY_PASSWORD=root mysql:latest

另外-最好是空文件夹挂载

Usage against an existing database
If you start your mysql container instance with a data directory that already contains a database (specifically, a mysql subdirectory), the $MYSQL_ROOT_PASSWORD variable should be omitted from the run command line; it will in any case be ignored, and the pre-existing database will not be changed in any way.

参考的一些文章

(https://help.aliyun.com/noticelist/articleid/8504221.html)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值