Home > Software design >  Export MySQL Table to CSV file through Batch File
Export MySQL Table to CSV file through Batch File

Time:01-19

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?

CodePudding user response:

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';

  • Related