MongoDB 3.2 authentication failed

前端 未结 4 1612
萌比男神i
萌比男神i 2020-11-29 02:06

I create a user with the following set of commands. This should create user in both admin db as well as my target db (c2d):

# mongo 127         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 02:46

    try --authenticationDatabase=admin option in your terminal mongo command, if admin is the authentication database.

    For example:

    insteed of: mongo 127.0.0.1:27017/c2d -u c2d -p c2d

    use: mongo 127.0.0.1:27017/c2d -u c2d -p c2d --authenticationDatabase=admin

提交回复
热议问题