mongodb 导入导出记录一则

root@c78d49f4:/bin# ./mongodump -u root -p Dz123456 --port 27017 --authenticationDatabase admin -d sim -o /data/sim_backup

--authenticationDatabase  应该是通过admin库进行账号权限验证

root@bdc2fff68e7e:/home# cat aa.sh
mongorestore -u root -p Dz123456 --port 27017 --authenticationDatabase admin -d sim /home/sim

posted @ 2022-05-09 13:35  beawh  阅读(20)  评论(0编辑  收藏  举报