Mongodb Atlas: not authorized on admin to execute command

前端 未结 9 1775
小蘑菇
小蘑菇 2021-02-12 17:56

I have a MongoDB Atlas cluster within which I am trying to simply copy a database within the same instance. Unfortunately, every time I try to run db.copyDatabase() or copydb ad

9条回答
  •  眼角桃花
    2021-02-12 18:39

    In my case I had this issue while trying to connect to mongodb atlas.I removed the error by removing these from the mongdb uri string . ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true

    Original link : mongodb+srv://username:password@hostname/dbname?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true

    After rectification : mongodb+srv://username:password@hostname/dbname

提交回复
热议问题