select * from xx_xx into outfile '/root/xxx/iii.csv';
使用导出后的错误:
ERROR 1 (HY000): Can't create/write to file '' (Errcode: 13)
现有的修改权限 chown myslq:mysql /root/xxx
不好使
接着报错ERROR 1 (HY000): Can’t create/write to file ‘/data/test1.txt’ (Errcode: 13)
把root目录也加权限后好使了
排查过程
查看当前路径, mysql shell
\! pwd
\T /root/xxx
如果出现:
mysql: Can’t create/write to file ‘/root’ (Errcode: 21)
Error logging to file ‘/root/xxx’
表示不具有写权限。
如果只出现
Logging to file '/root/xxx/iii.csv'’
表示具有写的权限。