Friday, June 19, 2015

Notes: exporting database from MySQL and importing to MongoDB

MySQL data came from sample data of test-db - https://launchpad.net/test-db

mysqldump --tab=/tmp --fields-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by=0x0d0a employees

mongoimport --db=employees -c=employees -f emp_no,birth_date,first_name,last_name,gender,hire_date --file=employees.txt --type=csv

No comments: