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!)

completely erase and reinstall mysql script.

mysql says you can't login as root but you have definitely got the right password