Lee
Lee

Reputation: 181

Export database record as CSV file

Is there any way to export database records as CSV file from Mysql Workbench by using command line syntax?

Upvotes: 0

Views: 164

Answers (2)

Mike Lischke
Mike Lischke

Reputation: 53532

MySQL Workbench comes with a table data export function, which supports csv and json formats. You can start it from the context menu in the schema tree:

enter image description here

The simple wizard then allows you to select the output data type:

enter image description here

Similarly, there's the table data import wizard that can read csv and json data.

Upvotes: 0

Proxytype
Proxytype

Reputation: 722

SELECT orderNumber, status, orderDate, requiredDate, comments 
FROM orders
WHERE status = 'Cancelled'
INTO OUTFILE 'C:/tmp/cancelled_orders.csv'
FIELDS ENCLOSED BY '"' TERMINATED BY ';' ESCAPED BY '"'
LINES TERMINATED BY '\r\n';

more information here:

http://www.mysqltutorial.org/mysql-export-table-to-csv/

Upvotes: 1

Related Questions