MongoDB connecting to authenticationdatabase using shell command -


when connect using os shell,

mongo --port 27017 -u "testusr" -p "testpwd"  --authenticationdatabase "testdb" 

instead of switching taking me testdb, logs me test database? missing here?

db.auth("testusr","testpwd") working wihtout authentication issues? how redirect correct database?

the following works me

mongo localhost:27017/testdb -u "user" -p "pass"  --authenticationdatabase "testdb" 

you can find help(i used in linux)

mongo --help usage: mongo [options] [db address] [file names (ending in .js)] db address can be: foo                   foo database on local machine 192.169.0.5/foo       foo database on 192.168.0.5 machine 192.169.0.5:9999/foo  foo database on 192.168.0.5 machine on port 9999 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -