MySQL: CSV Storage Engine, Store Table data into CSV File

One of the most things that I liked about MySQL RDBMS is, It supported different types of Storage Engine for different types of requirement.

I have also published one related article, How to import and export CSV data in MySQL.

MySQL: Import and Export CSV data with Headers

Additionally, MySQL has a wonderful CSV (Comma Separated Value) storage engine to store table data directly into CSV file.

When you create any table with CSV storage engine, It creates table_name.frm file and table_name.csv file into /../MySQL/Data/Database directory.

You can easily open that table_name.csv file and You can also SELECT that CSV table data using MySQL Query Window.

Few Important Points:

CSV storage engine does not support NULL columns, all columns must be NOT NULL.
CSV storage engine does not support any type of Indexing.
CSV storage engine does not support Table Partitioning.

Create a sample table using CSV Stroage Engine:

Insert few records:

Check the result of table and also check .csv file which is created in /../MySQL/Data/Database directory.

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of