command line authentication of mongo fails

前端 未结 4 1554
青春惊慌失措
青春惊慌失措 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 11:04

    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'
    

提交回复
热议问题