Building connection from MongoDB to RDB SQL data server ODBC for analysis

SamSam
3 min readJan 14, 2022

--

Here are the reference links:

https://docs.mongodb.com/bi-connector/current/
https://github.com/mongodb/mongo-odbc-driver
https://github.com/mongodb/mongo-bi-connector-odbc-driver

All the data are masked. Security is our top priority.

Environment:
Windows Server 2016
MongoDB
SQL Server 2016 (建議可改用MySQL)

Data flow:
MongoDB -> SQL Server 2016

Steps:
1. Download and install Mongo BI connector
2. Activate Mongo BI connector service
3. Download and install Mongo BI connector ODBC driver
4. Set ODBC
5. Use SQL Server linked server as example
6. Use Tableau linked to ODBC as example

It seemed simple but it’s definitely not if you browsing yourself. Trust me, I’m the only simple way on the internet.

Follow the sub-steps to complete the activation.

a. Create an file with your editor (.conf):

systemLog:
path: ‘C:\logs\mongosqld.log’
net:
bindIp: ‘127.0.0.1’
port: 3307
schema:
path: ‘C:\Program Files\MongoDB\Connector for BI\2.14\bin\mongo.drdl’

b. Use cmd install mongosqld:

cd C:\Program Files\MongoDB\Connector for BI\2.14\bin\

mongosqld install — config “C:\Program Files\MongoDB\Connector for BI\2.14\bin\mongosqld.conf”

c. Use cmd activate mongosqld service:

net start mongosql

d. Reveiw logs

Please choose MySQL as option. The connector transformed for you already.

Test the connection

Fxxking 3 hours!!!

Be caerful about MSDASQL configuration

The sample of query. And

Or you would NOT see the data shown. I’ve stuck for 3 hours.

MongoDB BI Connector is supported for specific version. Choose ODBC to make sure.

--

--

SamSam
SamSam

Written by SamSam

用有限的資料知識探索無限的世界

No responses yet