APPX 4.2.9, MySQL, and UnixODBC on RHEL 5/Scientific Linux 5/Oracle Linux 5/CentOS 5
Overview
This document will demonstrate how to configure APPX 4.2.9 and MySQL on a 64 bit or 32 bit Red Hat 5 based Linux server using 32 bit unixODBC drivers.
32 Bit
APPX and MySQL can be configured using the unixODBC drivers in 32 bit Red Hat 5 using all packages found in the default package manager.
Installing MySQL
MySQL can be installed with yum by installing the following packages:
mysql.i386 : MySQL client programs and shared libraries
mysql-server.i386 : The MySQL server and related files
Installing UnixODBC and the MySQL ODBC Connector
UnixODBC can also be installed using yum by installing the following packages:
unixODBC.i386 : A complete ODBC driver manager for Linux
mysql-connector-odbc.i386 : ODBC driver for MySQL
Configuring odbc.ini and odbcinst.ini
The odbcinst.ini file, found in /etc, must be configured to point to the 32-bit MySQL ODBC Connector driver. The default configuration on my install had the wrong driver version listed, so it may need to be changed to match the driver version you have installed.
[root@slinux ~]# cat /etc/odbcinst.ini
# Example driver definitinions
#
#
# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc3.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
[root@slinux ~]#
odbc.ini may also need to be edited. It was a blank text file on my tests before I edited it. Make sure all the information in the file matches your system. It should look similar to this:
[root@slinux ~]# cat /etc/odbc.ini
[mysql]
Description = mysql
Driver = mysql
Server = localhost
Database = test
Port =
Socket =
Option =
Stmt =
[root@slinux ~]#
Configuring appx.env
The appx.env file has a line beginning with APPX_ODBC_LIB, which points to the MySQL UnixODBC Connector driver. It can be remarked out. APPX should not have any trouble locating the driver without it.
#APPX_ODBC_LIB=/usr/lib/libmyodbc5.so
64 Bit
APPX and MySQL can be configured to work, using 32 bit unixODBC on a 64 bit Red Hat based linux server using the 32 bit ODBC connector driver.
Installing MySQL
To install MySQL, install the packages named mysql.x86_64 and mysql-server.x86_64 using yum.
mysql.x86_64 : MySQL client programs and shared libraries
mysql-server.x86_64 : The MySQL server and related files
Installing UnixODBC
Yum can also be used to install unixODBC. You will need to specify the 32 bit version. The package is named unixODBC.i386. You will also need the connector driver.
unixODBC.i386 : A complete ODBC driver manager for Linux.
mysql-connector-odbc.i386 : ODBC driver for MySQL
Installing the ODBC Connector
The MySQL ODBC connector might not be included in the repository yum uses. Since I am running Scientific Linux 5, I downloaded the package from the Scientific Linux website. Once the rpm is downloaded, yum can do a local install, which will take care of any dependencies for you.
wget http://ftp.scientificlinux.org/linux/scientific/56/i386/SL/mysql-connector-odbc-3.51.26r1127-1.el5.i386.rpm
yum localinstall /root/mysql-connector-odbc-3.51.26r1127-1.el5.i386.rpm
Connfiguring odbc.ini and odbcinst.ini
The odbcinst.ini file, found in /etc, must be configured to point to the 32-bit MySQL ODBC Connector driver. The default configuration on my install had the wrong driver version listed, so it may need to be changed to match the version of the driver you have installed. This is what mine looks like:
[root@slinux data]# cat /etc/odbcinst.ini
# Example driver definitinions
#
#
# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc3.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
[root@slinux data]#
odbc.ini may also need to be edited. It was a blank text file on my tests before I edited it. Make sure all the information in the file matches your system. It should look similar to this:
[root@slinux data]# cat /etc/odbc.ini
[mysql]
Description = mysql
Driver = mysql
Server = localhost
Database = test
Port =
Socket =
Option =
Stmt =
[root@slinux data]#
Configuring appx.env
The appx.env file has a line beginning with APPX_ODBC_LIB, which points to the MySQL UnixODBC Connector driver. It can be remarked out. APPX should not have any trouble locating the driver without it.
#APPX_ODBC_LIB=/usr/lib/libmyodbc5.so
Troubleshooting/Testing
32 Bit
ISQL can be used to test the connection between MySQL and unixODBC using the MySQL ODBC Connector driver. ISQL isn't necessary for APPX to connect to MySQL, but it can be a useful tool for testing the driver APPX will be using. Bitness shouldn't be an issue with 32 bit Red Hat. A successful test should look like this:
[root@slinux ~]# isql mysql
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
64 Bit
ISQL can be used to test the connection between
MySQL and unixODBC using the 32-bit
MySQL ODBC Connector driver. ISQL isn't necessary for APPX to connect to
MySQL, but it can be a useful tool for testing the driver APPX will be using. You will need to have the 32-bit ISQL file for it to be a valid test, otherwise it will be testing the 64-bit driver, which is not used in APPX. To find out the bitness of ISQL, run the file command on it. This is how it should look(ELF 32-bit):
[root@slinux bin]# file isql
isql.32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
[root@slinux bin]#
If it looks like this(ELF 64-bit), you will need to get the 32-bit version:
[root@slinux bin]# file isql
isql: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
[root@slinux bin]#
A positive test using ISQL should result in something like this:
[root@slinux lib]# isql mysql
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
Comments:
Read what other users have said about this page or add your own comments.