select * from test into outfile '/home/user/test.txt'
在linux(centos)下 ,启动了mysql 并给用户文件读写的权利
grant file on *.* to root@localhost;
在linux系统上,目录的权限全部是 rwxrwxrwx
chmod 777 ...
/home/user/test
drwxrwxrwx 4 root root 4096 Sep 3 18:42 home
drwxrwxrwx 10 mapuser mapuser 4096 Sep 4 03:41 user
drwxrwxrwx 5 mapuser mapuser 4096 Sep 3 17:57 test
在mysql下输入
select * from test into outfile '/home/user/test.txt'
出现错误信息:
ERROR 1 (HY000): Can't create/write to file '/home/user/test.txt' (Errcode: 13)
当时如果是tmp目录的话就不会有这个错误
select * from test into outfile '/tmp/test.txt'
Query OK, 0 rows test(0.00 sec)
难道只能是tmp目录吗?
有什么地方可以修改的吗?
后来吧home的所有者改成了mysql
drwxrwxrwx 5 mysql mysql 4096 Sep 4 10:08 home
select * from test into outf