Documentation Home
MySQL Connector/ODBC Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb
EPUB - 1.2Mb
HTML Download (TGZ) - 1.1Mb
HTML Download (Zip) - 1.2Mb

MySQL Connector/ODBC Developer Guide  /  Configuring Connector/ODBC  /  Configuring a Connector/ODBC DSN on OS X

5.4 Configuring a Connector/ODBC DSN on OS X

To configure a DSN on OS X, you can either use the command-line utility (myodbc-installer), edit the odbc.ini file within the Library/ODBC directory of the user, or use the ODBC Administrator GUI. If you have OS X 10.2 or earlier, refer to Section 5.5, “Configuring a Connector/ODBC DSN on Unix”. Select whether to create a User DSN or a System DSN. When adding a System DSN, you might need to authenticate with the system. Click the padlock and enter a user and password with administrator privileges.

For correct operation of ODBC Administrator, ensure that the /Library/ODBC/odbc.ini file used to set up ODBC connectivity and DSNs are writable by the admin group. If this file is not writable by this group, then the ODBC Administrator may fail, or may appear to work but not generate the correct entry.


There are known issues with the OS X ODBC Administrator and Connector/ODBC that may prevent you from creating a DSN using this method. In this case, use the command line or edit the odbc.ini file directly. Existing DSNs or those that you created using the myodbc-installer tool can still be checked and edited using ODBC Administrator.

To create a DSN using the myodbc-installer utility, you need only specify the DSN type and the DSN connection string. For example:

shell> myodbc-installer -a -s -t"DSN=mydb;DRIVER=MySQL ODBC 5.2 Driver;SERVER=mysql;USER=username;PASSWORD=pass"

To use ODBC Administrator:

  1. Open the ODBC Administrator from the Utilities folder in the Applications folder.

    ODBC Administrator Main Panel Dialog
  2. On the User DSN or System DSN panel, click Add.

  3. Select the Connector/ODBC driver and click OK.

  4. You will be presented with the Data Source Name dialog. Enter the Data Source Name and an optional Description for the DSN.

    ODBC Administrator Add DSN Dialog

  5. Click Add to add a new keyword/value pair to the panel. Configure at least four pairs to specify the server, username, password and database connection parameters. See Section 5.2, “Connector/ODBC Connection Parameters”.

  6. Click OK to add the DSN to the list of configured data source names.

A completed DSN configuration may look like this:

ODBC Administrator Sample DSN Dialog

You can configure other ODBC options in your DSN by adding further keyword/value pairs and setting the corresponding values. See Section 5.2, “Connector/ODBC Connection Parameters”.

User Comments
Sign Up Login You must be logged in to post a comment.