# Can't connect to mlab MongoDB

**URL:** <https://community.dremio.com/t/cant-connect-to-mlab-mongodb/1698>\
**Category:** Uncategorized\
**Created:** [August 23, 2018, 3:42pm UTC](https://community.dremio.com/t/cant-connect-to-mlab-mongodb/1698 "2018-08-23T15:42:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@amit](https://community.dremio.com/u/amit)\
**Post date:** [August 23, 2018, 3:42pm UTC](https://community.dremio.com/t/cant-connect-to-mlab-mongodb/1698/1 "2018-08-23T15:42:07Z")

</div>

I’m trying to connect to a MongoDB hosted on mlab. I tried using admin as the authentication db and I also tried to use my own DB as the auth db (though I’m not sure that’s a correct config) but it keeps failing. Using WireShark I can see that Dremio is carrying out a short conversation with my DB server, but it fails to establish a connection. I tried extending the timeout significantly too.  
I’ve attached 2 logs - one for each type of attempt.

[DremioConnectionFailure.zip](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/1X/d6da0b828738a71faa2253f3ed33fed8795f63f1.zip) (6.0 KB)

---

<div class="post-metadata">

**Author:** ![amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@amit](https://community.dremio.com/u/amit)\
**Post date:** [August 24, 2018, 11:22am UTC](https://community.dremio.com/t/cant-connect-to-mlab-mongodb/1698/2 "2018-08-24T11:22:29Z")

</div>

I finally figured it out, so for the benefit of anybody else looking for similar information:

1. If you’re not using an mLab dedicated plan, the authentication db is just your regular db name which you’re trying to connect to.
2. If you’re on a replica set, you have to add a connection string parameter, which is the parameter provided by mLab at the end of the connection string - replicaSet=
3. You might have to extend the timeout beyond the default 2000ms
