How to export table data in MySql Workbench to csv?

Mysql Workbench

Mysql Workbench Problem Overview


I am wondering how do I export table data into a csv? I read that I need to use mysql workbench command line but I can not figure out how to launch the cmd line(don't know what the command is).

Running on Windows 7 64bit.

Mysql Workbench Solutions


Solution 1 - Mysql Workbench

You can select the rows from the table you want to export in the MySQL Workbench SQL Editor. You will find an Export button in the resultset that will allow you to export the records to a CSV file, as shown in the following image:

MySQL Workbench Export Resultset Button

Please also keep in mind that by default MySQL Workbench limits the size of the resultset to 1000 records. You can easily change that in the Preferences dialog:

MySQL Workbench Preferences Dialog

Hope this helps.

Solution 2 - Mysql Workbench

U can use mysql dump or query to export data to csv file

SELECT *
INTO OUTFILE '/tmp/products.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM products

Solution 3 - Mysql Workbench

MySQL Workbench 6.3.6

Export the SELECT result
  • After you run a SELECT: Query > Export Results...

    Query Export Results

Export table data
  • In the Navigator, right click on the table > Table Data Export Wizard

    Table Data Export

  • All columns and rows are included by default, so click on Next.

  • Select File Path, type, Field Separator (by default it is ;, not ,!!!) and click on Next.

    CSV

  • Click Next > Next > Finish and the file is created in the specified location

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionchobo2View Question on Stackoverflow
Solution 1 - Mysql WorkbenchSergioView Answer on Stackoverflow
Solution 2 - Mysql WorkbenchNeetiView Answer on Stackoverflow
Solution 3 - Mysql WorkbenchROMANIA_engineerView Answer on Stackoverflow