How should I tackle --secure-file-priv in MySQL?(我应该如何处理 MySQL 中的 --secure-file-priv?)
问题描述
我正在学习 MySQL 并尝试使用 LOAD DATA
子句.当我使用它时:
I am learning MySQL and tried using a LOAD DATA
clause. When I used it as below:
LOAD DATA INFILE "text.txt" INTO table mytable;
我收到以下错误:
MySQL 服务器正在使用 --secure-file-priv 选项运行,因此它无法执行此语句
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
我该如何解决这个错误?
How do I tackle this error?
我已经检查了 关于同一错误消息的另一个问题,但仍然找不到解决方案.
I have checked another question on the same error message, but still can’t find a solution.
我使用的是 MySQL 5.6
I am using MySQL 5.6
推荐答案
它按预期工作.您的 MySQL 服务器已启动 --secure-file-priv 选项基本上限制了您可以使用 LOAD DATA INFILE
从哪些目录加载文件.
It's working as intended. Your MySQL server has been started with --secure-file-priv option which basically limits from which directories you can load files using LOAD DATA INFILE
.
您可以使用 SHOW VARIABLES LIKE "secure_file_priv";
查看已配置的目录.
You may use SHOW VARIABLES LIKE "secure_file_priv";
to see the directory that has been configured.
您有两个选择:
- 将您的文件移动到
secure-file-priv
指定的目录. - 禁用
secure-file-priv
.这必须从启动中删除,不能动态修改.为此,请检查您的 MySQL 启动参数(取决于平台)和 my.ini.
- Move your file to the directory specified by
secure-file-priv
. - Disable
secure-file-priv
. This must be removed from startup and cannot be modified dynamically. To do this check your MySQL start up parameters (depending on platform) and my.ini.
这篇关于我应该如何处理 MySQL 中的 --secure-file-priv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我应该如何处理 MySQL 中的 --secure-file-priv?


基础教程推荐
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在多列上分布任意行 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01