UnixODBC HOWTO

# aptitude install unixodbc unixodbc-bin unixodbc-dev odbcinst1debian1 libmyodbc

Configure drivers in /etc/odbcinst.ini:

[MySQL]
Description     = MySQL driver for Linux & Win32
Driver          = /usr/lib/odbc/libmyodbc.so
Setup           = /usr/lib/odbc/libodbcmyS.so
FileUsage       = 1
UsageCount      = 1

Configure data-sources in /etc/odbc.ini:

[test]
Description = MySQL Test
Driver      = MySQL
SERVER      = localhost
USER        = username
PASSWORD    = password
PORT        = 3306
DATABASE    = test
Option      = 3

And test:

isql test

If your installing UnixODBC for use with a web-based scripting language like iHTML then you'll need to set the ownership and/or permissions for odbc.ini so that the web-server user can read the file. For standard configurations the user will be www-data, for mpm-itk or su-php configurations you'll need to grant the virtual group read access.

Discussion

Enter your comment (wiki syntax is allowed):

Subscribe to the RSS feed for Andy's Debian HOWTOs

Article from Andy's Debian HOWTOs (http://www.besy.co.uk/debian/debian)

 
debian/how_to_install_and_configure_unixodbc.txt · Last modified: 2008/11/13 09:46 by andy · [Old revisions]
Recent changes RSS feed Powered by Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki