ITPub博客

首页 > 数据库 > MySQL > 【Mysql】into outfile报错的问题

【Mysql】into outfile报错的问题

原创 MySQL 作者:小亮520cl 时间:2017-05-31 18:08:00 0 删除 编辑
明明有select 权限却报错
mysql> select * from server into outfile '/tmp/tt.txt';
ERROR 1045 (28000): Access denied for user 'chenliang'@'%' (using password: YES)

百度后需要给file权限
mysql>  grant file on *.* to chenliang;
Query OK, 0 rows affected (0.00 sec)


再次导还是报错
mysql> select * from server into outfile '/tmp/tt.txt';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
--这次错误不一样了,这个错误是一个参数导致的


配置文件加入后重启
secure_file_priv=''  


导出成功
mysql> select * from server into outfile '/tmp/tt.txt';
Query OK, 27 rows affected (0.00 sec)


这个参数我以前在5.6.24版本都没调整过,可能默认值就是‘’,高版本默认值改成null,所以一定要注意

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29096438/viewspace-2140122/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 【GP】执行计划
请登录后发表评论 登录
全部评论
毕业以后专业任职数据库工程师职位,itpub一直作为自己的笔记记录的地方,blog写的不详细,草书笔记,仅供参考!

注册时间:2013-09-12

  • 博文量
    529
  • 访问量
    1126951