iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >Failed to access directory for --secure-file-priv. Please make sure that directory exists and is ac
  • 463
分享到

Failed to access directory for --secure-file-priv. Please make sure that directory exists and is ac

数据库mysqllinux 2023-09-13 13:09:15 463人浏览 八月长安
摘要

使用Docker安装Mysql,挂载外部配置和数据时启动失败 [MY-010095] [Server] Failed to access directory for --secure-file-pri

使用Docker安装Mysql,挂载外部配置和数据时启动失败

[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 docker容器

docker run -p 3307:3306 --name mysql-master \-v ~/mydata/mysql-master/log:/var/log/mysql \-v ~/mydata/mysql-master/data:/var/lib/mysql \-v ~/mydata/mysql-master/conf:/etc/mysql \-e MYSQL_ROOT_PASSWord=root  \-d mysql:8.0.22

发现docker容器无法启动,报错如下:

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

解决方法

在my.cnf配置文件中添加如下内容:

解决问题:
windows下:修改my.ini 在[mysqld]内加入secure_file_priv=/var/lib/mysql

linux下:修改my.cnf 在[mysqld]内加入 secure_file_priv=/var/lib/mysql

[mysqld]## 设置server_id,同一局域网中需要唯一server_id=101## 指定不需要同步的数据库名称binlog-ignore-db=mysql## 开启二进制日志功能log-bin=mall-mysql-bin## 设置二进制日志使用内存大小(事务)binlog_cache_size=1M## 设置使用的二进制日志格式(mixed,statement,row)binlog_fORMat=mixed## 二进制日志过期清理时间。默认值为0,表示不自动清理。expire_logs_days=7## 跳过主从复制中遇到的所有错误或指定类型的错误,避免slave端复制中断。## 如:1062错误是指一些主键重复,1032错误是因为主从数据库数据不一致slave_skip_errors=1062secure_file_priv=/var/lib/mysql

来源地址:https://blog.csdn.net/m0_52896752/article/details/129811650

您可能感兴趣的文档:

--结束END--

本文标题: Failed to access directory for --secure-file-priv. Please make sure that directory exists and is ac

本文链接: https://www.lsjlt.com/news/405965.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作