How To Export a CSV File from MySQL Workbench?

How To Export a CSV File from MySQL Workbench?

  • Blog
  • 2 mins read

Here I am giving two examples, to export a CSV file from MySQL Workbench using the SQL editor and using the table data export wizard option. Both the options are very easy to use, please check the below.

Follow These Steps to Export a CSV File from MySQL Workbench Using SQL Editor

  1. Open MySQL Workbench and connect to the database.
  2. Set a default database to run a query in that database.
  3. Then open an SQL editor by pressing the Ctrl+T.
  4. Type your query in the SQL editor, for example, select customer_id, first_name, last_name, email from customer; and then press Ctrl+Enter to execute. The records will appear in the grid below.
  5. Then click on the Export/Import button as shown in the below image:

Export CSV from MySQL table using WorkBench.

  1. Then Export ResultSet dialog box will appear and will ask you to specify the filename. Give a filename and click on the Save button.

You can check the file at the specified location you saved.

Export a CSV File in MySQL Workbench Using Table Data Export Wizard

  1. Perform first two steps mentioned above.
  2. Then left side in Schema navigator, expand the schema node.
  3. Select a table and do the right click on it.
  4. From the shortcut menu, choose Table Data Export Wizard option.
  5. A window will appear as shown in the below image:

Export wizard MySQL Workbench

  1. Here you can select the table and select/deselect the columns from a table. Then click on the Next button.
  2. The window will appear as shown below. Specify the file path and name, specify the delimiter, and field enclosed string then click on the Next button and again on the next step click on the Next button to export the CSV file using MySQL Workbench table export wizard.

MySQL Workbench Table Export Wizard Options

You can find the file at the specified path.

See also:

How to Install MySQL on Windows 10? (Version 8.0.14)