TSV (much easier to use in practice due to lack of need to escape)
INTO OUTFILE '/tmp/pageviews.tsv'
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
CSV (if you must)
INTO OUTFILE '/tmp/pageviews.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Note: won’t include column names. There’s no easy way to do this from within mysql, though can be done from the command line.