[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)