Keep trying but cant connect

On windows 10

λ mongo “mongodb+srv://” --username m220student
MongoDB shell version v4.0.3
Enter password:
connecting to: mongodb+srv://
Implicit session: session { “id” : UUID(“893aeace-ef1e-4b37-84c7-0ed76331f7fd”) }
MongoDB server version: 4.0.9
2019-05-15T17:32:02.547+1000 E QUERY [js] Error: Authentication failed. :
exception: login failed

Please check your password. Also, you can pass password as a parameter in connection string itself:

 mongo “mongodb+srv://” --username m220student --password <REPLACE_PASSWORD>


I’ve tried the right password but keep getting the same login failed

I am able to connect using the below command:

mongo "mongodb+srv://" --username m220student --password m220password


Which command line tool did you use? Would that make a difference?
I am using Cmder

No, it should not. :frowning:

It might be a case that some characters get converted which your command line tool failed to understand but thats a guess. Can you try on some different tool?


I tried on gitBash and windows power shell and both got a login failed

Try without quotes:

 mongo mongodb+srv:// --username m220student --password m220password

Please share the full screenshot containing the command and the output of the error.


Thanks for the screenshot @Gregdd. I am trying to replicate the issue.


Hi @Gregdd,

I tried replicating the issue but I am unable to do so.
Please install 4.0.9 current version of MongoDB from and then try again.

Let me know how it goes.


Thanks for looking into it -I’ll uninstall all mongoDB - reinstall and post how it goes.

Uninstalled and reinstalled everything - still the same problem.

I removed the word test from the url and it worked!
Thanks again for looking into this for me.

mongo “mongodb+srv://” --username m220student - // no good
mongo “mongodb+srv://” --username m220student - // all good

Glad you got it working @Gregdd!! :slight_smile:


Dear All,
In Windows 10, getting error while executing command from CMD prompt “pytest -m connection”
also not able to connect to “http://localhost:5000/

Please help, thanks in advance.



Hi @Sanjay_52594,

Please share the error you are getting in the prompt.


Dear Kanika

URI string is working properly


but python is giving error.


Sanjay Pawar

If the URI is fine, your .ini must not be formatted correctly.

In particular, you are showing the content of dotini_win.ini. You seem to have ignore the step that says:
Rename this file to .ini after filling in your …

1 Like