export data from mysql table to csv

Q & ACategory: Systemexport data from mysql table to csv
sovandara Staff asked 6 months ago

Hi,

I want to export data from mysql data to csv file. Is it able to do from mysql command line?

 

1 Answers
sovandara Staff answered 6 months ago

Hi,

You can try use the below command
==================================
SELECT User_ID,User_name,address
FROM users
INTO OUTFILE ‘/home/orders.csv’
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘\n’;
===============================

Your Answer

20 + 16 =