RoboMongo 无法连接MongoDB(Exception sending message)(Exception authenticatig)
一. 环境
我的系统:windows10
MongoDB version: 4.0.4
RoboMongo: studio 3T 2018.5.0
二. 问题
今天在安装RoboMongo studio3T之后在连接MongoDB的时候一直连接不上,按照网上的教程,用户名是"admin",问题如下
三. 解决过程:
1. 在查找资料的过程中,有一篇帖子提到在log中没有发现问题,让我恍然大悟,可以去查log呀!!!!
2. 在log中写的很清楚,请求被接受,但服务器不支持SSL,这就是错误原因,所以需要我们修改RoboMongo 中 connect 配置,取消掉就好了,之后再Test Connection
3. 很不幸又出错了,但这次提示很简单,提示没有这个用户,所以需要我们现在MongoDB中手动添加我们的用户 ‘admin’
4.需要通过命令行进入到MongoDB的安装目录下的bin文件夹下,之后输入`mongo`,如图
之后输入下图中的两条命令
第一条:use admin
第二条 :db.createUser({user:"admin", pwd:"123456", roles:[{role:"userAdminAnyDatabase", db:"admin"}]})
5. 完成之后再去测试连接,这时已经可以通过了