解决Mongodb认证auth error: sasl conversation error: unable to authenticate using mechanism “SCRAM-SHA-1“

解决方法

在输入用户名密码的同时添加--authenticationDatabase admin,这个是验证用户名与密码所需的数据库

通用的公式是:

./mongorestore 
	-h 127.0.0.1:27017
	--authenticationDatabase 验证用户名密码所需的数据库(默认为admin) 
	-u 用户名 
	-p 密码

示例:

./mongorestore 
	-h 127.0.0.1:27017
	--authenticationDatabase admin
	-u mongo_root 
	-p mongo_password

问题解析

固定写法

你可能感兴趣的:(运维,mongodb,数据库,nosql)