Search code examples
mongodbparse-platformparse-server

Can't connect to MongoDB with Connection String


I'm trying to migrate an app from parse to my selfhosted server. I want to migrate the mongoDB but something's wrong with my connection String:

mongodb://user:pwd@X.X.X.X:27017/dev

The version of mongo:

db version v3.2.9-rc0

When I'm starting the connection I always get the error that the authentication failed. The mongo terminal says:

SCRAM-SHA-1 authentication failed for calimotoDev on dev from client 54.85.236.190 ;
AuthenticationFailed: SCRAM-SHA-1 authentication failed, storedKey mismatch

It seems that the password is wrong, but it's definitely not. When I try to connect my selfhosted parse server to mongoDB with this connection string everything's fine.

Please help me, I'm searching for hours to solve this problem.


Solution

  • The exception image


    I had the same problem and contacted support@mlab.com and they suggested me to escape my password (xxx-yyy-zzz) (This wasn't my problem though)
    So I did this:

    var url = new MongoUrl(connectionString);
    var client = new MongoClient(url);
    

    This is c# but should be similar to other languages.