A password containing special characters, especially the dollar sign, has to be put in single quotes to protect them from the command shell:
$ mongo admin -u uname -p 'password'
Answer from ronasta on Stack OverflowA password containing special characters, especially the dollar sign, has to be put in single quotes to protect them from the command shell:
$ mongo admin -u uname -p 'password'
You have to use the --authenticationDatabase to indicate mongodb where to find the user you have created. For example:
mongo admin -u uname -p 'password' --authenticationDatabase admin
Videos
Maybe I'm wrong but the correct form is like this:
mongo --port 27017 -u manager -p 12345678 --authenticationDatabase admin
You can read about this in mongo documentation:
http://docs.mongodb.org/manual/tutorial/add-user-to-database/
The issue was resolved by removing any symbols. It appears that despite quotes [single or double] would cause the incoming password to be invalid.
mongo --shell
will open the shell interface.
https://docs.mongodb.com/manual/reference/program/mongo/
Both the mongod (database server) and mongo (database client shell) programs are command line programs and each expects to be run in its own command line session. So, after starting the server (as you did with "./mongod") you should open a second command line session and run "./mongo" in it to give you a command line shell for talking to the server.