首页 > 数据库技术 > 详细

【MySQL报错】ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

时间:2019-11-08 17:03:30      阅读:314      评论:0      收藏:0      [点我收藏+]

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

mysql 默认对导出的目录有权限限制,也就是说使用命令行进行导出的时候,需要指定目录进行操作;

解决方法:

方法一:

  使用语句查询secure_file_priv 的值:show global variables like ‘%secure%‘;

方法二:

  使用 into outfile 开始导出:(因为secure_file_priv配置的关系,所以必须导出到  /var/lib/mysql-files/目录下)

select * from table_name where a = test
into outfile /var/lib/mysql-files/test.txt  FIELDS TERMINATED BY , OPTIONALLY ENCLOSED BY " LINES TERMINATED BY \n;

PS:FIELDS TERMINATED BY  ‘,‘  OPTIONALLY ENCLOSED BY  ‘ " ‘  LINES TERMINATED BY ‘\n‘;因为导出的数据会出现一些乱码或者特殊字符,所以使用以上关键字进行转义

 

 

 

 

【MySQL报错】ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

原文:https://www.cnblogs.com/HeiDi-BoKe/p/11821409.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!