简体   繁体   中英

SELECT INFO OUTFILE (Errcode: 13), CentOS

So I have this code...

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());

I get this error...

Can't create/write to file '/home/user/public_html/feed-processed/processed.csv' (Errcode: 13)

I've read that you need to give the mysql user FILE access, but I don't know which user mysql is running under (as i've been told it's different from the user your running commands under). Is there an easy way to tell and then update the permissions?

Thanks in advance for any help, you guys are always awesome!

您必须在mysql根帐户下执行查询

GRANT FILE ON *.* TO 'username'@'host'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM