Unable to connect to database

When I run the following command, I receive this error message:

mongosh “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --tls -u m121 -p aggregations

MongoServerSelectionError: connect ETIMEDOUT

Hi @Dominick_Banasik,

Looks like you are in Atlas. Use the Connect button to retrieve the correct connection string which should use the DNS seed list instead of the direct IPs.

It looks like this for one of my clusters:

mongosh "mongodb+srv://freesandbox.abcde.mongodb.net/myFirstDatabase" --apiVersion 1 --username polux

Also, don’t forget to add your public IP address in the IP access list.


Your VPN, firewall or ISP might be blocking the traffic. What do you get when you try to go to http://portquiz.net:27017.

It works, I get a response

1 Like

Post a screenshot of doing that.

1 Like

You should be fine then.

You could try again to access the shared M121 jxeqq server. May be you had temporary network issues that are now resolved.

No luck. I still get the same error message

Tyr with


Same issue. Must be something on my end

Hi Dominick, I actually tried from my side and the command line works and able to connect. Your network firewall must have dropped the packets.

1 Like