mongodb备份和恢复整个数据库

1、备份

mongodump -h <hostname>:<port> -d <dbname> -o <dbdirectory>

解释:dbname指数据库,dbdirectory指备份存放目录

2、恢复

mongorestore -h <hostname>:<port> -d <dbname> <dbdirectory>

猜你喜欢

转载自blog.csdn.net/daijiguo/article/details/81151527