我尝试使用将 csv 文件加载到表中
load data infile 'C:\\a.csv' into table errorClick columns terminated by ',' lines terminated by ',\r\n' ignore 1 lines;
我使用的是 sql 版本 8.0 它给出了错误:
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement 0.000 sec
我运行了这个声明:
SHOW VARIABLES LIKE "secure_file_priv";
结果是
secure_file_priv C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\
然后我尝试了
Set secure_file_priv="";
给出了结果
Error Code: 1238. Variable 'secure_file_priv' is a read only variable 0.047 sec
然后我尝试在我的 Windows 10 计算机中的位置找到 my.ini
C:\ProgramData\MySQL\MySQL Server 8.0\
我没有找到任何my.ini
文件;请帮我解决这个错误;
最佳答案
只能在my.inio文件中修改,然后重启服务器
您在隐藏文件夹中找到 my.ini
C:\ProgramData\MySQL\MySQL Server 8.0
您可以在该部分下找到
[mysqld]
secure-file-priv = ""
编辑完成后,您需要重新启动服务器,以使更改生效。
关于mysql - 如何在Windows 10机器中禁用MySQL 8.0中的secure_file_priv?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62640963/