我应该如何处理 MySQL 中的 --secure-file-priv?

How should I tackle --secure-file-priv in MySQL?(我应该如何处理 MySQL 中的 --secure-file-priv?)
本文介绍了我应该如何处理 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.

您有两个选择:

  1. 将您的文件移动到 secure-file-priv 指定的目录.
  2. 禁用secure-file-priv.这必须从启动中删除,不能动态修改.为此,请检查您的 MySQL 启动参数(取决于平台)和 my.ini.
  1. Move your file to the directory specified by secure-file-priv.
  2. 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)