所以我有这个代码......
mysql_query("SELECT * INTO OUTFILE '/home/user/public_html/feed-processed/processed.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\r\\n' FROM tbl_name") or die ('QueryBACKUP failed: ' .mysql_error());
我收到此错误...
Can't create/write to file '/home/user/public_html/feed-processed/processed.csv' (Errcode: 13)
我已经读过你需要给mysql用户FILE访问权限,但是我不知道在哪个用户下运行mysql(因为我被告知它与你运行命令的用户不同)。是否有一种简单的方法来判断并更新权限?
在此先感谢您的帮助,你们总是很棒!
答案 0 :(得分:-1)
您必须在mysql root account
下执行查询GRANT FILE ON *.* TO 'username'@'host'