I'm trying a cloud of Mongo Atlas. I am creating a cluster and I am trying to establish a connection with the mongo shell: (same problem with mongo drivers)
mongo mongodb://***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017/any_database?replicaSet=****-Cluster-shard-0 --ssl --username ***** --password *****
this is the connection string in the documentation. And this is a mistake:
MongoDB shell version: 3.2.7 connecting to: mongodb://***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017/any_database?replicaSet=***-Cluster-shard-0 2016-07-07T01:31:17.535-0300 I NETWORK [thread1] Starting new replica set monitor for ***-Cluster-shard-0/***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017 2016-07-07T01:31:17.535-0300 I NETWORK [ReplicaSetMonitorWatcher] starting 2016-07-07T01:31:20.084-0300 E QUERY [thread1] Error: Authentication failed. : DB.prototype._authOrThrow@src /mongo/shell/db.js:1441:20 @(auth):6:1 @(auth):1:2 exception: login failed
I can connect to the database only when I use the admin database "/ admin?". in the connection string.
PROBLEM:
I need to connect to a user database using console drivers or mongo.
PD: I protect my data with "***"
source share