mongo 数据备份用户名加密码

语法

mongodump命令脚本语法如下:

>mongodump -h dbhost -d dbname -o dbdirectory

-h:

MongDB所在服务器地址,例如:127.0.0.1,当然也可以指定端口号:127.0.0.1:27017
-d:

需要备份的数据库实例,例如:test
-o:

备份的数据存放位置,例如:c:\data\dump,当然该目录需要提前建立,在备份完成后,系统自动在dump目录下建立一个test目录,这个目录里面存放该数据库实例的备份数据。

 

mongodump -h localhost -d article -o ~/Documents/tmp/ -u=root -p=123456 --authenticationDatabase admin

http://www.waitingfy.com/archives/3670

3670

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.