To configure a DSN on Mac OS X you can either use the
myodbc3i utility, edit the
odbc.ini
file within the
Library/ODBC
directory of the user or the
should use the ODBC Administrator. If you have Mac OS X 10.2 or
earlier, refer to
Section 17.1.4.5, “Configuring a Connector/ODBC DSN on Unix”. Select
whether you want to create a User DSN or a System DSN. If you
want to add a System DSN, you may need to authenticate with the
system. You must click the padlock and enter a user and password
with administrator privileges.
For correct operation of ODBC Administrator, you should 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 have worked but not generated 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 you should use the command-line or
edit the odbc.ini
file directly. Note
that existing DSNs or those that you create via the
myodbc3i or
myodbc-installertool can still be checked
and edited using ODBC Administrator.
To create a DSN using the myodbc3i utility, you need only specify the DSN type and the DSN connection string. For example:
shell> myodbc3i -a -s -t"DSN=mydb;DRIVER=MySQL ODBC 3.51 Driver;SERVER=mysql;USER=username;PASSWORD=pass"
To use ODBC Administrator:
Open the ODBC Administrator from the
Utilities
folder in the
Applications
folder.
On the User DSN or System DSN panel, click Add.
Select the Connector/ODBC driver and click OK.
You will be presented with the Data Source
Name
dialog. Enter The Data Source
Name
and an optional
Description
for the DSN.
Click Add to add a new keyword/value
pair to the panel. You should configure at least four pairs
to specify the server
,
username
, password
and
database
connection parameters. See
Section 17.1.4.2, “Connector/ODBC Connection Parameters”.
Click OK to add the DSN to the list of configured data source names.
A completed DSN configuration may look like this:
You can configure additional ODBC options to your DSN by adding further keyword/value pairs and setting the corresponding values. See Section 17.1.4.2, “Connector/ODBC Connection Parameters”.
User Comments
Add your own comment.