I can't connect the Mongo Shell

I’m using the Short SRV connection string and I get this:

mongo “mongodb+srv://cluster0-fknmb.mongodb.net/test” --username m001-student

MongoDB shell version: 3.2.8

2019-02-27T16:11:57.504-0500 E QUERY [thread1] Error: Invalid port number “//cluster0-fknmb.mongodb.net” in connection string “mongodb+srv://cluster0-fknmb.mongodb.net/test” :



exception: connect failed

Then I try the standard connection string and I get this:
MongoDB shell version: 3.2.8

connecting to: mongodb://cluster0-shard-00-00-fknmb.mongodb.net:27017,cluster0-shard-00-01-fknmb.mongodb.net:27017,cluster0-shard-00-02-fknmb.mongodb.net:27017/test?replicaSet=Cluster0-shard-0

2019-02-27T16:13:40.138-0500 I NETWORK [thread1] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-fknmb.mongodb.net:27017,cluster0-shard-00-01-fknmb.mongodb.net:27017,cluster0-shard-00-02-fknmb.mongodb.net:27017

2019-02-27T16:13:40.138-0500 I NETWORK [ReplicaSetMonitorWatcher] starting

2019-02-27T16:13:40.715-0500 W NETWORK [thread1] No primary detected for set Cluster0-shard-0

2019-02-27T16:13:40.715-0500 I NETWORK [thread1] All nodes for set Cluster0-shard-0 are down. This has happened for 1 checks in a row. Polling will stop after 29 more failed checks

What DO I do?

I ended up uninstalling mongo because I couldn’t upgrade from 3.2.8. Then I tried to manually install, but the instructions don’t work for me. Then I used home-brew and that finally worked, but I only have 4.0.3. I still want to know how to install mongo manually. Copying the tar file to my user path and extracted the file by double clicking which produced the file. Then I changed my $PATH to the on my user path. Still this doesn’t work. Why won’t it work manually?

There are 2 ways which you mentioned:

  1. Using home-brew
  2. Downloading -> Extracting -> Updating $PATH

I am able to install both ways. Which way did not work for you?

If it’s second, then make sure your $PATH only have PATH to MONGODB new version and not the previous one.