Keep trying but cant connect

On windows 10

λ mongo “mongodb+srv://mflix-mfz3r.mongodb.net/test” --username m220student
MongoDB shell version v4.0.3
Enter password:
connecting to: mongodb+srv://mflix-mfz3r.mongodb.net/test
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. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1685:20
@(auth):6:1
@(auth):1:2
exception: login failed

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

 mongo “mongodb+srv://mflix-mfz3r.mongodb.net/test” --username m220student --password <REPLACE_PASSWORD>

Kanika

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://mflix-mfz3r.mongodb.net/test" --username m220student --password m220password

Kanika

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?

Kanika

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

Try without quotes:

 mongo mongodb+srv://mflix-mfz3r.mongodb.net/test --username m220student --password m220password

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

Kanika

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

Kanika

Hi @Gregdd,

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

Let me know how it goes.

Kanika

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

Uninstalled and reinstalled everything - still the same problem.

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

mongo “mongodb+srv://mflix-mfz3r.mongodb.net/test” --username m220student - // no good
mongo “mongodb+srv://mflix-mfz3r.mongodb.net” --username m220student - // all good

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

Kanika

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.

Regards

Sanjay.

Hi @Sanjay_52594,

Please share the error you are getting in the prompt.

Kanika

Dear Kanika

URI string is working properly

mongodb+srv://m220student:m220password@mflix-l8oxy.mongodb.net/test?retryWrites=true

but python run.py is giving error.

Thanks

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