【Mongo】数据库导入导出
一、数据库导出
1、导出命令 [mongodump]
mongodump -u 'root' -p '123456' --authenticationDatabase 'admin' -d test -o ./
-u 用户名
-p 密码
-h ip
–port 端口号
–authenticationDatabase 认证数据库
-d 导出数据库
-o 导出位置
二、数据库导入
1、导入命令 [mongorestore]
mongorestore -u 'root' -p '123456' --authenticationDatabase 'admin' -d test --dir ./
-u 用户名
-p 密码
-h ip
–port 端口号
–authenticationDatabase 认证数据库
-d 导入数据库名称
-dir 导入文件目录