Cipher Log

Chronicles in Language, Technology, and Law

Exporting MySQL databases

October 22, 2015

If you ever have a need to export your MySQL data into a portable format for use in a program, import into another database, or use in a spreadsheet, you can tell MySQL to save your information as comma-separated values (what's called "CSV format"):

SELECT field1, field2, field3 INTO OUTFILE '/Users/home/default/database.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY ‘\\’ LINES TERMINATED BY '\n' FROM users WHERE 1

Via Ariejan de Vroom

0 Comment(s)

Post a Comment