1 2 3 4 5 6 7 8 9 10 11 12 13 14
| mongodump --uri mongodb+srv://jaxson:密码@cluster0.jzont.mongodb.net/ --archive="mongodump-test-db" --db=myFirstDatabase
mongodump --host=159.75.255.88 --port=27017 --username=jaxson --archive="mongodump-test-db" --db=myFirstDatabase
mongorestore --host=159.75.255.88 --port=27017 --username=jaxson --archive="mongodump-test-db" --nsFrom='myFirstDatabase.*' --nsTo='myFirstDatabase.*'
show dbs
db.createUser({user:"jaxson",pwd:"",roles:["readWrite"]})
db.system.users.find().pretty()
db.dropUser('test')
|