mysql没有写入权限_解决select ... into outfile '..' mysql写文件权限问题

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值