Mongodb 命令createIndexes需要身份验证
获取以下错误 我让mongodb docker在远程系统上运行。我可以通过mongo控制台登录并创建索引 在运行mvnw时,我遇到以下异常 完整响应为{“ok”:0.0,“errmsg”:“command createindex requires authentication”,“code”:13,“codeName”:“Unauthorized”};嵌套异常为com.mongodb.MongoCommandException:命令失败,错误为13(未经授权):“Command createIndexes需要身份验证”在服务器xxxxxx:27017上。完整响应为{“ok”:0.0,“errmsg”:“command createindex requires authentication”,“code”:13,“codeName”:“Unauthorized”} 我创建了具有所有角色的用户。谢谢你的帮助Mongodb 命令createIndexes需要身份验证,mongodb,jhipster,Mongodb,Jhipster,获取以下错误 我让mongodb docker在远程系统上运行。我可以通过mongo控制台登录并创建索引 在运行mvnw时,我遇到以下异常 完整响应为{“ok”:0.0,“errmsg”:“command createindex requires authentication”,“code”:13,“codeName”:“Unauthorized”};嵌套异常为com.mongodb.MongoCommandException:命令失败,错误为13(未经授权):“Command createIn
db.createUser( { 用户:“jhipster”, pwd:“杰普斯特”, 角色:[{role:“dbAdmin”,db:“argumentationMap”},{role:“readWrite”,db:“argumentationMap”},{role:“dbAdmin”,db:“argumentationMap”},{role:“userAdmin”,db:“argumentationMap”}] } )这对我很有效 在my application.yml文件中:
spring:
data:
mongodb:
database: dbname
username: dbuser
password: userpassword
authentication-database: dbname
host: yourIpaddrr
port: 27017
在pom.xml文件中,我更改了
<dependency>
<groupId>com.github.mongobee</groupId>
<artifactId>mongobee</artifactId>
</dependency>
com.github.mongobee
蒙戈贝
到
com.github.dalet-oss
蒙戈贝
1.0.4
我希望它能帮助别人
<dependency>
<groupId>com.github.dalet-oss</groupId>
<artifactId>mongobee</artifactId>
<version>1.0.4</version>
</dependency>