安全文件专用空集 [英] secure-file-priv Empty set
问题描述
Windows 2007MySQL 5.7
Windows 2007 MySQL 5.7
接收错误:
错误1290(HY000):MySQL服务器正在使用--secure-file-priv选项运行,因此它无法执行此语句
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
所以我认为这只是我存储数据库的目录的特权错误.
So I assumed that it was simply a privilege error for the directory that I had stored my DB.
所以我跑了:
类似于"secure-file-priv"的显示变量;
SHOW VARIABLES LIKE "secure-file-priv";
并返回:
空集(0.00秒)
Empty set (0.00 sec)
所以我搜索了"my.ini"my.ini位于C:\ ProgramData \ MySQL \ MySQL Server 5.7
so I searched for "my.ini" my.ini is located in C:\ProgramData\MySQL\MySQL Server 5.7
MySQL安装在C:\ Program Files(x86)
MySQL is installed in C:\Program Files (x86)
我将Links.csv复制到my.ini的文件夹位置,并且错误仍然返回.
I made a copy of my Links.csv into the folder location of my.ini and the error still returned.
脚本:
mysql> LOAD DATA INFILE'Links.csv'到表链接;
mysql> LOAD DATA INFILE 'Links.csv' INTO TABLE Links;
推荐答案
我正在使用Windows 10.
I'm using Windows 10.
检查:
mysql> SELECT VERSION();
+------------+
| VERSION() |
+------------+
| 5.7.17-log |
+------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'secure_file_priv';
+------------------+--------------------------------+
| Variable_name | Value |
+------------------+--------------------------------+
| secure_file_priv | V:\PATH\TO\MySQL Server\Files\ |
+------------------+--------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT `VARIABLE_VALUE`
-> FROM `performance_schema`.`global_variables`
-> WHERE `VARIABLE_NAME` = 'secure_file_priv';
+--------------------------------+
| VARIABLE_VALUE |
+--------------------------------+
| V:\PATH\TO\MySQL Server\Files\ |
+--------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT @@GLOBAL.secure_file_priv;
+--------------------------------+
| @@GLOBAL.secure_file_priv |
+--------------------------------+
| V:\PATH\TO\MySQL Server\Files\ |
+--------------------------------+
1 row in set (0.00 sec)
如果需要更改路径,则必须在 my.ini
文件中进行操作:
If you need to change the path, you must do it in the my.ini
file:
# Secure File Priv.
secure-file-priv="V:/NEW/PATH/TO/MySQL Server/Files"
然后重新启动MySQL :(以我为例):
then restart MySQL: (in my case):
V:\>net stop MySQL
V:\>net start MySQL
这篇关于安全文件专用空集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!