Navigation

Create a System DSN

The following steps describe how to create a system Data Source Name (DSN) for the mongosqld process. A DSN is a saved configuration which describes a database connection to be used by an ODBC driver. Once defined and registered, a DSN can be used to connect to the BI Connector from several MySQL clients.

Prerequisites

Before creating a DSN, you should:

Create a System DSN (Windows)

1

Start the Microsoft ODBC Sources program as user administrator.

To run the program as administrator, right click on the application icon and select “Run as administrator”).

2

Select the System DSN tab.

3

Click the Add button.

Screenshot of the Windows ODBC Administrator application
4

Select MySQL ODBC Unicode Driver from the list of available drivers.

5

Fill in the necessary form fields.

Click the Details button to expose the lower half of the form.

The following form fields are required:

Field Name Description
Data Source Name A name of your choice.
TCP/IP Server Address of the server where your mongosqld process is running.
Port Port number of your mongosqld process.
User

Required when running with --auth enabled. Username of the MongoDB user who is authenticated to use the database named in your schema file. Append the database name to the username in the format:

<username>?source=<database-name>

For example, if user dbUser is authenticated on database inventory, the User field should contain the string dbUser?source=inventory.

Password Required when running with --auth enabled. The authenticated user’s password.
Database The name of the database the user is authenticated to use.
Authentication

Required when running with --auth enabled. The default authentication method. To use the authentication plugin, fill in this field with the string mongosql_auth.

Note

The Authentication field is at the bottom of the form. Be careful not to miss it.

The following example configuration assumes the following:

  • A mongosqld instance running on localhost port 3307 with authentication enabled.
  • A mongod instance running with authentication enabled.
  • A MongoDB user named dbUser who is authenticated to use the test database.

The values you enter may be different.

Screenshot of the Windows ODBC Administrator application
6

Click the Test button to test the ODBC connection.

If the connection is successful, click OK to add the DSN. If the connection fails, check to make sure your MongoDB user is correctly authenticated for the database named in the connection, and that the authentication plugin is installed.