6

I tried to connect to MongoDB in AWS using Robomongo. When I connect, I got this error:

Cannot connect to the MongoDB at x.x.x.x:27017

Error:
Missing expected field "mechanism"

Does anyone know how to solve this error? I already open the 27017 port to 0.0.0.0.

Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
  • First off, mongodb does not run on AWS RDS, so those tags cannot apply to this question. Second, opening your database to the world is a very bad idea. Third, can you connect to mongodb with another tool, like mongo shell? – Karen B Jul 20 '16 at 19:55
  • Yup, you are right. It turns out it was in the instance. Sorry, I am still quite a newbie in AWS and moreover website security. Never mind, I already able to connect using Robomongo – Aminah Nuraini Jul 20 '16 at 19:57

1 Answers1

14

In Robomongo change in Connection Settings - Authentication - Auth Mechanism from SCRAM-SHA-1 to MONGODB-CR.

  • What is difference between SCRAM-SHA-1 and MONGODB-CR. – surekha shelake Jun 07 '17 at 10:30
  • I quote from the developer (http://docs.mongodb.com/v3.4/core/security-scram-sha-1): MongoDB’s implementation of SCRAM-SHA-1 represents an improvement in security over the previously-used MONGODB-CR, providing: - A tunable work factor (iterationCount), - Per-user random salts rather than server-wide salts, - A cryptographically stronger hash function (SHA-1 rather than MD5), - Authentication of the server to the client as well as the client to the server. – Артём Кузьменко Jun 13 '17 at 11:03