解决MySQL下把结果导出到文件权限不足问题

      解决MySQL下把结果导出到文件权限不足问题

select ... into outfile '..' 权限问题

在MySQL下把结果导出到文件,总是权限不足。

mysql> select * into outfile 'e:/mysql/i0812.txt' fields terminated by '|' lines
terminated by '\r\n' from samtest;
ERROR 1 (HY000): Can't create/write to file 'e:\mysql\i0812.txt' (Errcode: 2)

解决方法,赋权:

mysql> grant file on *.* to root@localhost;

原文地址:https://www.cnblogs.com/bull_think/p/2766934.html