To save a table into a CSV

 To save a table into a CSV (spreadsheet) file:


select * from TableName INTO OUTFILE '/var/lib/mysql-files/spreadsheet.csv' FIELDS ENCLOSED BY '"' TERMINATED by ';' ESCAPED BY '"' LINES TERMINATED BY '\n'


This will drop the file into the folder /var/lib/mysql-files/


Comments

Popular posts from this blog

what to do if you crashed your database OR it says there are no tables (but there are!)

Permanently save login password for mysql client