我正在学习 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.secure-file-priv.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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 SparkSQL 删除 MySQL 表Dropping MySQL table with SparkSQL(使用 SparkSQL 删除 MySQL 表)
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
Spark SQL/Hive 查询永远需要加入Spark SQL/Hive Query Takes Forever With Join(Spark SQL/Hive 查询永远需要加入)
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
在 Spark 中找不到适合 jdbc 的驱动程序No suitable driver found for jdbc in Spark(在 Spark 中找不到适合 jdbc 的驱动程序)