database

How do I export a MySQL table to a .csv file?

select * into outfile ‘/tmp/table.csv’ FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘\n’
from mytable;

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top