On Unix, you configure DSN entries directly
in the odbc.ini file. Here is a typical
odbc.ini file that configures
myodbc26w (Unicode)
and myodbc26a (ANSI)
as DSN names for Connector/ODBC 26.7:
;
; odbc.ini configuration for Connector/ODBC 26.7 driver
;
[ODBC Data Sources]
myodbc26w = MyODBC 26.7 UNICODE Driver DSN
myodbc26a = MyODBC 26.7 ANSI Driver DSN
[myodbc26w]
Driver = /usr/local/lib/libmyodbc26w.so
Description = Connector/ODBC 26.7 UNICODE Driver DSN
SERVER = localhost
PORT =
USER = root
Password =
Database = test
OPTION = 3
SOCKET =
[myodbc26a]
Driver = /usr/local/lib/libmyodbc26a.so
Description = Connector/ODBC 26.7 ANSI Driver DSN
SERVER = localhost
PORT =
USER = root
Password =
Database = test
OPTION = 3
SOCKET =
Refer to the Section 5.2, “Connector/ODBC Connection Parameters”, for the list of connection parameters that can be supplied.
If you are using unixODBC, you can use the
following tools to set up the DSN:
ODBCConfigGUI tool (HOWTO: ODBCConfig)odbcinst
In some cases when using unixODBC, you might
get this error:
Data source name not found and no default driver specified
If this happens, make sure the ODBCINI and
ODBCSYSINI environment variables are pointing
to the right odbc.ini file. For example, if
your odbc.ini file is located in
/usr/local/etc, set the environment
variables like this:
export ODBCINI=/usr/local/etc/odbc.ini
export ODBCSYSINI=/usr/local/etc