Export csv file from mongodb and import into mysql

1. Export csv file: Create a csv file containing all the key names of the collection to be exported

2. Enter the mongodb installation root directory, use mongoexport, -d (database name), -c (collection name), -o (file name), --type (output format), -f (output fields must be!)

For example mine is mongoexport -d waibao1 -c keywords -f _Id,keyword --type=csv -o C:\users\hp\desktop\data\xxx.csv

3, Import the csv file: Since I downloaded xampp, I directly manipulate mysql and import the csv file.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325058971&siteId=291194637