command line authentication of mongo fails

前端 未结 4 1525
青春惊慌失措
青春惊慌失措 2020-12-25 10:37

I am running mongo 2.2.2 on osx.

When I do the following authentication is going fine:

$ mongo
>> use admin
>> db.auth(\"uname\", \"passw         


        
4条回答
  •  离开以前
    2020-12-25 10:57

    This is the way to access an authenticate MongoDB database from terminal

    mongo -u user_name -p "your_password" host_name/database_name
    

    Ex:

    mongo -u hasib -p "123456" localhost/my_db
    

提交回复
热议问题