简体   繁体   中英

Export MySQL Table to CSV file through Batch File

I need to export my MySQL tables to CSV files with a batch file. Is there any option like that?

I am getting many ETL references in Google search, but is there any command line arguments, which can be used in batch file so that I can export the data in CSV format with headers?

There is an URL export mysql table to csv file using batch script regarding this, but not clear, what to write in the batch file.

Can anyone please help me?

SELECT * FROM firstdb.user
INTO OUTFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/employee_backup.csv'   
FIELDS ENCLOSED BY '"'   
TERMINATED BY ';'   
ESCAPED BY '"'   
LINES TERMINATED BY '\r\n';  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM