Spec-Zone .ru
спецификации, руководства, описания, API

22.1.4.5. Configuring a Connector/ODBC DSN on Unix

On Unix, you configure DSN entries directly in the odbc.ini file. Here is a typical odbc.ini file that configures myodbc3 as the DSN name for Connector/ODBC 3.51:

;;  odbc.ini configuration for Connector/ODBC and Connector/ODBC 3.51 drivers;[ODBC Data Sources]myodbc3     = MyODBC 3.51 Driver DSN[myodbc3]Driver       = /usr/local/lib/libmyodbc3.soDescription  = Connector/ODBC 3.51 Driver DSNSERVER       = localhostPORT         =USER         = rootPassword     =Database     = testOPTION       = 3SOCKET       =[Default]Driver       = /usr/local/lib/libmyodbc3.soDescription  = Connector/ODBC 3.51 Driver DSNSERVER       = localhostPORT         =USER         = rootPassword     =Database     = testOPTION       = 3SOCKET       =

Refer to the Section 22.1.4.2, "Connector/ODBC Connection Parameters", for the list of connection parameters that can be supplied.

Note

If you are using unixODBC, you can use the following tools to set up the DSN:

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.iniexport ODBCSYSINI=/usr/local/etc