ODBC Driver for MongoDB



ODBC Driver for MongoDB works under control of an ODBC driver manager. ODBC driver manager is not distributed along with our driver and must be installed separately.

ODBC Driver for MongoDB is compatible with 2 ODBC driver managers:

In case when using other ODBC driver managers, ODBC Driver for MongoDB will be installed, but it will require manual modification of configuration files of these managers.


To install the driver, you should download the archive containing installation files, unpack and run installation with root privileges. See the detailed description of these steps below:

  1. Download the archive from Devart website. By default the archive will be downloaded into the ~/Downloads folder (or the selected one);
  2. Run the 'Terminal' program;
  3. Navigate to the folder with the downloaded archive cd ~/Downloads (if you downloaded the archive into another folder, you need to specify the path to this folder as the cd command parameter):
    cd ~/Downloads/

  4. Unpack devartodbcmongo-linux.tar:
    tar -xf devartodbcmongo-linux.tar

  5. Execute the install.sh script with root user privileges and specify the password:
    sudo ./install.sh

  6. Read the EULA carefully.

  7. Agree to the license agreement:

  8. Select the installation folder for ODBC Driver for MongoDB (or accept the suggested path):

  9. Select the used ODBC driver manager (UnixODBC by default):

  10. Specify the path (or remain the default: /etc) to odbc.ini and odbcinst.ini files.

  11. If you have an activation key, you should create a file, for example with the "mongo.lic" name on your computer and paste the activation key into it. Then specify the path to it in order to activate the product.

    To add/update the mongo.lic file to an already installed driver, you need to create/replace this file in the directory with the installed driver, and save the new activation key to it.

Driver is installed successfully.

After the driver is installed, two DSNs with the names DEVART_MONGODB_X64 and DEVART_MONGODB_X86 are created. You can use them to test connection with MONGODB server, we will use DEVART_MONGODB_X86 as an example. Now perform the following steps:

  1. Open the odbc.ini file, the location of which was indicated during the installation. Find the DEVART_MONGODB_X86 section and specify the required connection settings:
    Server=<your MongoDB server address>
    Port=<your MongoDB Port>
    Database=<your MongoDB database name>
  2. Run the UnixODBC Test Command utility and test connection using the following command:
    isql -v DEVART_MONGODB_X86 

Installing MongoDB client libraries

ODBC Driver for MongoDB requires libmongoc and libbson client libraries to be installed on the PC. The driver dynamically loads client libraries (by default, libmongoc-1.0.so.0 and libbson-1.0.so.0) available in the user system. If you do not have these libraries installed, you can use ones distributed with the driver.

After the driver is installed, four libraries will be copied to the driver installation folder:

The easiest way to make libraries available for the driver is to create symbolic links to them in one of the folders available on the system.

  1. Run the 'Terminal' program;
  2. On the x86 system execute the following commands with root user privileges and specify the password:
    sudo ln -s -f /usr/local/devart/odbcmongo/libmongoc-1.0.x86.so /usr/local/lib/libmongoc-1.0.so.0

    sudo ln -s -f /usr/local/devart/odbcmongo/libbson-1.0.x86.so /usr/local/lib/libbson-1.0.so.0

  3. On the x64 system execute the following commands with root user privileges and specify the password:
    sudo ln -s -f /usr/local/devart/odbcmongo/libmongoc-1.0.x64.so /usr/local/lib/libmongoc-1.0.so.0

    sudo ln -s -f /usr/local/devart/odbcmongo/libbson-1.0.x64.so /usr/local/lib/libbson-1.0.so.0

See also:

© 2015-2017 Devart. All Rights Reserved. Request Support ODBC Forum Provide Feedback