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
- Open MySQL Workbench and connect to the database.
- Set a default database to run a query in that database.
- Then open an SQL editor by pressing the Ctrl+T.
- 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.
- Then click on the Export/Import button as shown in the below image:
- 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
- Perform first two steps mentioned above.
- Then left side in Schema navigator, expand the schema node.
- Select a table and do the right click on it.
- From the shortcut menu, choose Table Data Export Wizard option.
- A window will appear as shown in the below image:
- Here you can select the table and select/deselect the columns from a table. Then click on the Next button.
- 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.
You can find the file at the specified path.