Mysql How to outfile in csv format, with sheets options?

Viewed 731

I want to export data from mysql into a csv. There are many tables so I want a csv file with many sheets. How it can be done?

I suppose somethings like:

SELECT *
FROM product
WHERE active = 1
INTO OUTFILE '/root/tmp/data.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

SELECT *
FROM member
WHERE active = 1
INTO OUTFILE '/root/tmp/data.csv' // using the same .csv
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

etc...
1 Answers
Related