I'm trying to change my parse.com connection string to a mongoDB cluster and it giving me:
Server returned error on SASL authentication step: Authentication failed.
I'm using their Connection String:
mongodb://username:PASSWORD@cluster0-shard-00-00-xxxx.mongodb.net:xxxx,cluster0-shard-00-01-xxxx.mongodb.net:xxxx,cluster0-shard-00-02-xxxx.mongodb.net:xxxx/admin?replicaSet=Cluster0-shard-0
i've added their ip(54.85.224.0/20) to the trusted ips,I'm using admin to connect. I don't know what else to do, what am i missing? I'm totally new to this so please explain to me like i'm 5!
I was having a similar issue, in my case I was trying to connect to a different DB than admin. My problem was that I was changing "/admin" to "/cars" (my DB name) in the connection string.
Customer support kindly helped me out, some facts I learned:
So you have to change the db name and append "&authSource=admin" to the end of your connection string.
Example:
mongodb://username:PASSWORD@cluster0-shard-00-00-xxxx.mongodb.net:xxxx,cluster0-shard-00-01-xxxx.mongodb.net:xxxx,cluster0-shard-00-02-xxxx.mongodb.net:xxxx/admin?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.