Search This Blog

Friday, August 10

Export data from Mysql table to .CSV file


My-SQL Query for Export data from table to .CSV file


SELECT * INTO OUTFILE '/usr/tmp/<filename>.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM <TableName>

*TableName = Name of your SQL Table
*/usr/tmp/ <filename>.csv = path and name of the .csv file

*note path must be exists

No comments:

Post a Comment