Mongodb Atlas: not authorized on admin to execute command

前端 未结 9 1747
小蘑菇
小蘑菇 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:41

    This drove me insane... Turns out the standard link provided by MongoDB was trying to name my default database "admin". Change the link from

    mongodb+srv://username:password@portfoliosite-ezeot.mongodb.net/**admin**?retryWrites=true&w=majority 
    

    to

    mongodb+srv://username:password@portfoliosite-ezeot.mongodb.net/**test**?retryWrites=true&w=majority
    

    You can put any word in for test just not admin. Hope this helps!

提交回复
热议问题