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
Post a Comment