用初始密码登入
mongo -u atayun -p atayun2022
创建数据库并进入
use ebike
创建数据库用户 并赋予读写权限
db.createUser(
{
user: "writer",
pwd: "password",
roles: [ "readWrite"]
}
)
导出数据
mongodump --host 127.0.0.1 --port 27017 --username writer --password password --db ebike --out /data/db/base/
导入数据
mongorestore --host 127.0.0.1 --port 27017 --username writer --password password --db ebike ./ChargeStrategy.bson
标签:ebike,Mongo,--,writer,db,0.1,password
From: https://www.cnblogs.com/myDong/p/17879421.html