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

じ☆ve宝贝 1年前 ⋅ 1034 阅读

问题

MySQL 使用SELECT ... INTO OUTFILE将选中的行写入一个文件。列和行结束符可以指定生成一个特定的输出格式,结果提示:** The MySQL server is running with the --secure-file-priv option so it cannot execute this **

解决方案

SHOW VARIABLES LIKE '%secure%'; # 查看secure_file_priv的value地址 ** 将SQL改为(注意地址"","/"的区别) **

SELECT * INTO OUTFILE "${value}/test.sql" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM user;

全部评论: 0

    我有话说: