MongoDB创建用户报错command createUser requires authentication的解决方法
1、执行创建用户报错如下:

2、解决方法
2.1 关闭 MongoDB
/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongod.conf --shutdown
2.2 修改配置文件
vim /usr/local/mongodb/mongod.conf
将security.authorization值从enabled改为disabled

2.3 启动MongoDB
/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongod.conf
3、验证
use admin
db.createUser({user:"admin",pwd:"shenz2024",roles:[{role:"root",db:"admin"}]});
以上就是MongoDB创建用户报错command createUser requires authentication的解决方法的详细内容,更多关于MongoDB创建用户报错authentication的资料请关注万象站长学堂其它相关文章!
栏 目:MongoDB
下一篇:mongodb 中rs.stauts()命令参数解析
本文标题:MongoDB创建用户报错command createUser requires authentication的解决方法
本文地址:https://zhanzhang.eapis.site/html/1670.html
您可能感兴趣的文章




粤公网安备 13010202004186