【问题标题】:How to disable secure_file_priv in MySQL 8.0 in windows 10 machine?如何在 Windows 10 机器的 MySQL 8.0 中禁用 secure_file_priv?
【发布时间】:2020-10-19 18:48:39
【问题描述】:

我尝试使用将 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 文件;请帮我解决这个错误;

【问题讨论】:

  • 检查 MySQL 服务命令行以获取实际 .ini 文件的路径名。确保您有足够的访问权限来浏览其文件夹。

标签: mysql mysql-workbench mysql-8.0


【解决方案1】:

只能在my.inio文件中修改,然后重启他的服务器

您在隐藏文件夹中找到 my.ini

C:\ProgramData\MySQL\MySQL 服务器 8.0

您可以在该部分下找到

[mysqld]

secure-file-priv = ""

【讨论】:

    猜你喜欢
    • 2019-08-02
    • 2019-01-30
    • 2019-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多