Beginner issue with database connect

Hello @sam23

the connection string seems to be ok, quote or double quote should not matter. I can reach your DB, but not authenticate since I used my_username / password

mi01@LU30:~$ mongo 'mongodb+srv://cluster0-rsadq.mongodb.net' -u my_username -p password
MongoDB shell version v3.6.8
connecting to: mongodb+srv://cluster0-rsadq.mongodb.net
2020-06-24T07:05:20.706+0200 I NETWORK  [thread1] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-02-rsadq.mongodb.net.:27017,cluster0-shard-00-01-rsadq.mongodb.net.:27017,cluster0-shard-00-00-rsadq.mongodb.net.:27017
2020-06-24T07:05:20.793+0200 I NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Successfully connected to cluster0-shard-00-00-rsadq.mongodb.net.:27017 (1 connections now open to cluster0-shard-00-00-rsadq.mongodb.net.:27017 with a 5 second timeout)
2020-06-24T07:05:20.793+0200 I NETWORK  [thread1] Successfully connected to cluster0-shard-00-02-rsadq.mongodb.net.:27017 (1 connections now open to cluster0-shard-00-02-rsadq.mongodb.net.:27017 with a 5 second timeout)
2020-06-24T07:05:20.813+0200 I NETWORK  [thread1] changing hosts to Cluster0-shard-0/cluster0-shard-00-00-rsadq.mongodb.net:27017,cluster0-shard-00-01-rsadq.mongodb.net:27017,cluster0-shard-00-02-rsadq.mongodb.net:27017 from Cluster0-shard-0/cluster0-shard-00-00-rsadq.mongodb.net.:27017,cluster0-shard-00-01-rsadq.mongodb.net.:27017,cluster0-shard-00-02-rsadq.mongodb.net.:27017
2020-06-24T07:05:20.880+0200 I NETWORK  [thread1] Successfully connected to cluster0-shard-00-00-rsadq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-rsadq.mongodb.net:27017 with a 5 second timeout)
2020-06-24T07:05:20.887+0200 I NETWORK  [ReplicaSetMonitor-TaskExecutor-0] Successfully connected to cluster0-shard-00-02-rsadq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-02-rsadq.mongodb.net:27017 with a 5 second timeout)
2020-06-24T07:05:20.965+0200 I NETWORK  [thread1] Successfully connected to cluster0-shard-00-01-rsadq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-01-rsadq.mongodb.net:27017 with a 5 second timeout)
Implicit session: session { "id" : UUID("55b56a74-945f-47d9-923d-dabe2ab99112") }
MongoDB server version: 4.2.8
WARNING: shell and server versions do not match
2020-06-24T07:05:21.141+0200 I NETWORK  [thread1] Marking host cluster0-shard-00-02-rsadq.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node cluster0-shard-00-02-rsadq.mongodb.net:27017: Authentication failed.
2020-06-24T07:05:21.179+0200 I NETWORK  [thread1] Marking host cluster0-shard-00-00-rsadq.mongodb.net:27017 as failed :: caused by :: Location11002: can't authenticate against replica set node cluster0-shard-00-00-rsadq.mongodb.net:27017: socket exception [CONNECT_ERROR] for cluster0-shard-00-00-rsadq.mongodb.net:27017
2020-06-24T07:05:21.216+0200 I NETWORK  [thread1] Marking host cluster0-shard-00-01-rsadq.mongodb.net:27017 as failed :: caused by :: Location11002: can't authenticate against replica set node cluster0-shard-00-01-rsadq.mongodb.net:27017: socket exception [CONNECT_ERROR] for cluster0-shard-00-01-rsadq.mongodb.net:27017
2020-06-24T07:05:21.259+0200 I NETWORK  [thread1] Marking host cluster0-shard-00-02-rsadq.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node cluster0-shard-00-02-rsadq.mongodb.net:27017: Authentication failed.
2020-06-24T07:05:21.259+0200 E QUERY    [thread1] Error: can't authenticate against replica set node cluster0-shard-00-02-rsadq.mongodb.net:27017: Authentication failed. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1608:20
@(auth):6:1
@(auth):1:2
exception: login failed
mi01@LU30:~$

As Ramachandra noted, this seems to be more of an infrastructure problem.

1 Like