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

问题

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 条评论

    欢迎您,新朋友,感谢参与互动!
    // 友盟