1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this stat

报错

1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this stat_第1张图片

背景

windows上的mysql中执行into outfile导出语句的时候,报的这个错。

select "123" into outfile "D:\MySQL\data\MySQL Server 5.7\Uploads\aa.txt"

上面是SQL语句。
1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this stat_第2张图片

SELECT @@secure_file_priv;

上图中secure_file_priv配置的导出目录给返回的是D:\MySQL\data\MySQL Server 5.7\Uploads\。同时因为是在windows操作系统上,就使用了反斜杠()。

解决

SQL语句的中的目标路径需要使用斜杠(/),而不是反斜杠()。
1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this stat_第3张图片

select "123" into outfile "D:/MySQL/data/MySQL Server 5.7/Uploads/aa.txt"

1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this stat_第4张图片
还有个小点需要注意的是,当在配置文件中配置secure-file-priv的时候使用反斜杠(),是启动不了mysql服务的,必须像上图使用斜杠(/)。

你可能感兴趣的:(bug处理,mysql)