Cannot Connect server


when i type the ‘show collections’ command i did not get the collections. kindly help me

First, when you have a prompt like …:PRIMARY> then you are already connected to a server. You do not have to type mongo once again.

show collections shows the collections of the current database. It is possible that the current database does not have any collection. You may use show dbs to show the available databases and then use DatabaseName to make this database the current database.


Hi @Praveen_54345,

Please refer the post made by @steevej-1495.

If you still have any issue, feel free to get back to us. Happy Learning :slight_smile:

Shubham Ranjan
Curriculum Support Engineer

Hi, I selected “I have the Mongo Shell installed” option and copied the connection string, but it could not connect to server and the string is very different from the video. The following is the connection string.
mongo “mongodb+srv://” --username m001-student


Did it prompt for password for you?
I am able to connect

mongo “mongodb+srv://” --username m001-student
MongoDB shell version v4.0.5
Enter password:
connecting to: mongodb://,,
MongoDB server version: 4.0.12
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show dbs
admin 0.000GB
local 4.879GB

1 Like

Hi, In my case, there is no prompt for password and just shows some error message: Failed to parse mongodb…


It looks like that you did not copy the URI correctly because it starts with mongodb://mongodb+srv://. It should be mongodb+srv://.

1 Like

Problem solved. It is my bad. I have a old MongoDB version 3.4, so I didn’t set the PATH environment variable correctly. After I removed old one, it worked fine. Thanks!

1 Like