首页 > 解决方案 > 将 mongo 连接到 mlab 时出现问题(登录失败)

问题描述

我尝试将 mongo 连接到 mlab,但收到此错误:https ://imgur.com/a/mjN2lbe

$ ./bin/mongo.exe mongo ds*****.mlab.com:****/**** -u <username> -p
MongoDB shell version v3.6.4
Enter password:
connecting to: mongodb://127.0.0.1:27017/mongo
MongoDB server version: 3.6.4
2018-04-30T21:59:20.446+0700 E QUERY    [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1608:20
@(auth):6:1
@(auth):1:2
exception: login failed

我已经在 mlab 数据库上创建了这样的用户:https ://imgur.com/a/mjN2lbe但它仍然不起作用。我 100% 确定我没有输入错误的用户名或密码

标签: mongodbmlab

解决方案


推荐阅读