Export a MySQL query to an output file

Tags:

mysql -p DATABASE

(enter password)

SELECT * INTO OUTFILE "/tmp/table.txt" FROM TABLE;