Mongodb Atlas: not authorized on admin to execute command

前端 未结 9 1916
情书的邮戳
情书的邮戳 2021-02-12 18:08

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:38

    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!

提交回复
热议问题