2013-05-02

Access denied when using MySQL OUTFILE

When using mysql output file command, for example:
SELECT * FROM mydb.mytable INTO OUTFILE '/tmp/123.csv';
In some cases, you'll see this error message:
Access denied for user 'dbuser'@'localhost' (using password: YES) 
That means the mysql user you used is no privilege to write file.
Solution is to add FILE privilege into this user
GRANT FILE ON *.* TO 'dbuser'@'localhost'; 

No comments: