When you try to export data to a file you are getting an access denied error message. Even if you grant the user with full privileges on the database you must Grant Global Permission to the specified user and set File Privileges to Yes as well in order to export data to a file.
mysql> select * INTO OUTFILE ‘/tmp/file.out’ from TABLE;
“ERROR 1045 (28000): Access denied for user ‘db_user’@'localhost’ (using password: YES)”
mysql -u root -p
1. use mysql;
2. update user set File_priv = ‘Y’ where User = ‘db_user’;
3. FLUSH PRIVILEGES;
Leave a Comment