Refer below command.
SQL command for unload data
- select * into outfile '/tmp/testfile.txt' fields terminated by '|' from recharge where req_date<'2012-10-03';
SQL command to grant write permission
- GRANT FILE ON *.* TO 'sujith'@'localhost';
- flush privileges;