DeveloperBreeze

Sql Programming Tutorials, Guides & Best Practices

Explore 14+ expertly crafted sql tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Data Import and Export in MySQL

Tutorial August 12, 2024
mysql

To export data from a table to a CSV file, use the SELECT INTO OUTFILE statement:

SELECT * FROM your_table_name
INTO OUTFILE '/path/to/export.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';