'Authentication failed on admin database with just-created credentials

I'm trying to set up authorization on MongoDB server, but following different guides brings me to the same error :

"Authentication failed"

The account has been added successfully to Users table on Admin database, but once I set "authorization: enabled" I cannot connect to neither 127.0.0.1 nor localhost with the credentials I've specified above. Admin database connection return "Authentication failed" error with password specified and "Failed to load list of databases" without authentication settings specified.

What may be the reason for this? Google results mostly suggest updating MongoDB shell, but mine is the latest (3.4.10).



Solution 1:[1]

On Windows: Please set mongodb path in environment variable because sometimes powershell or Command Prompt have issue connecting to direct server or running mongo commands

Solution 2:[2]

Try replacing single quotes (') to double quotes (") and double quotes(") to backslash double quotes ("). Some terminals may not process single quotes correctly.

aws dynamodb update-item \
--table-name test \
--key "{\"testid\": {\"S\": \"testing\"}}" \
--update-expression "SET userType = :ut" \
--expression-attribute-values  "{\":ut\":{\"L\":[{\"S\":\"PRIMARY\"},{\"S\":\"SECONDRY\"}]}}" \
--return-values ALL_NEW

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmed Mujtaba
Solution 2 buddemat