Setting Up MongoDB Atlas and Connecting via Devart ODBC Driver

Setting Up MongoDB Atlas and Connecting via Devart ODBC Driver

This article will guide you through the process of setting up MongoDB Atlas, creating a cluster, configuring access, obtaining the connection string, and connecting to MongoDB Atlas using the Devart ODBC Driver for MongoDB.

1. Creating a Cluster in MongoDB Atlas

To begin using MongoDB Atlas, you need to create a cluster. Follow these steps:

Sign up or log in to your MongoDB Atlas account at MongoDB Atlas.

Once logged in, click on "Create a Cluster".

Choose:
  1. Shared Cluster (M0, free) or Dedicated Cluster (M10+). 
  2. Cloud provider and region (e.g., AWS, GCP, Azure). 
  3. Cluster name. 

2. Creating a User and Configuring Access

Next, you'll need to create a database user with the appropriate roles and configure network access.

Creating a Database User

In the MongoDB Atlas dashboard, go to Database Access and click Add New Database User.

Set up the following:
  1. Username: Enter a username for the new user.
  2. Password: Set a password (make sure to remember this for connection setup).
  3. Role: Select Read and Write to Any Database to provide full access to your databases.
Click Add User to create the new database user.

Configuring Network Access

Go to Network Access in the MongoDB Atlas dashboard and click Add IP Address.

Choose Allow Access from Anywhere (0.0.0.0/0) or specify your specific IP address to limit access.

Click Confirm to save your network access settings.

3. Getting the Connection String

To connect to your cluster, you need to obtain the connection string. Here's how:

In the MongoDB Atlas dashboard, go to Clusters and click Connect.

Select "Connect Your Application".

Copy the connection string that appears, which looks like this:
  1. mongodb+srv://USERNAME:PASSWORD@cluster0.xyz.mongodb.net/myDatabase?retryWrites=true&w=majority 
Replace USERNAME and PASSWORD with the credentials you created earlier.

Replace myDatabase with the name of the database you wish to connect to.
Picture 1, Зображення

4. Configuring Devart ODBC Driver for MongoDB

Now that your MongoDB Atlas cluster is set up and you have the connection string, you can connect using the Devart ODBC Driver for MongoDB.

Installing the Devart ODBC Driver for MongoDB

Download and install the Devart ODBC Driver for MongoDB from Devart's official website.

Configuring the ODBC Driver

Open the ODBC Data Sources (64-bit) application on your system.

Click Add to add a new data source.

Select Devart ODBC Driver for MongoDB from the list of available drivers.

In the configuration window, enter the following settings:
  1. Server: Paste the host part from your MongoDB connection string (e.g., cluster0.muw.mongodb.net).
  2. Port: Keep the default port as 27017.
  3. Database: Enter the name of the database you want to connect to (this should match the database name you specified in the connection string).
  4. Username: Enter the username you created earlier.
  5. Password: Enter the password you created earlier.
  6. Connection Format: Select DNS Seed List from the dropdown menu.
Picture 1, Зображення

Testing the Connection

Click Test Connection to ensure that the connection settings are correct and you can successfully connect to your MongoDB Atlas cluster.

If the test is successful, click OK to save the connection configuration.

You have now set up MongoDB Atlas, created a user, configured network access, and successfully connected to your MongoDB Atlas cluster using the Devart ODBC Driver for MongoDB. You can now access and manipulate your MongoDB data using ODBC-compliant tools.