When creating first admin user on mongdb cluster getting error “couldn't add user: not authorized on admin to execute command”

后端 未结 6 910
既然无缘
既然无缘 2021-02-04 19:10

I am using mongoDB Cluster with version 3.4 in google cloud compute engine, actually past week my database got attacked by hackers that\'s why i thought about using authorizatio

6条回答
  •  旧时难觅i
    2021-02-04 19:48

    johnlowvale's answer is correct, but

    keyFile implies security.authorization.
    

    source: https://docs.mongodb.com/manual/reference/configuration-options/#security.keyFile

    You have to disable authorization AND the keyFile.

    security:
      authorization: disabled
    # keyFile: /opt/mongodb/keyfile
    

    (insufficient rep or I'd have just commented this on johnlowvale's answer)

提交回复
热议问题