Tags:
create new tag
view all tags

APPX 4.2.9, MySQL, and UnixODBC on RHEL 6/Scientific Linux 6/Oracle Linux 6/CentOS 6


Overview

This document will demonstrate how to configure APPX 4.2.9 and MySQL on a 64 bit or 32 bit Red Hat based Linux server using 32 bit unixODBC drivers.

32-Bit Red Hat/Scientific Linux/Oracle Linux 6

Configuring APPX 4.2.9 and MySQL on 32 bit Red Hat using unixODBC drivers should be the simplest option because bitness shouldn't be an issue. Here is what I did to make it work:

Installing MySQL

MySQL can be installed with yum by installing the following packages:

mysql.i686 : MySQL client programs and shared libraries
mysql-server.i686 : 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.i686 : A complete ODBC driver manager for Linux
mysql-connector-odbc.i686 : 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. I didn't need to make any changes to this file, but if you are unable to connect, make sure the path to the 32-bit driver is correct. For APPX, the path to the 64 bit driver is not important.

[root@localhost ~]# cat /etc/odbcinst.ini
# Example driver definitions

# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description    = ODBC for MySQL
Driver         = /usr/lib/libmyodbc5.so
Setup          = /usr/lib/libodbcmyS.so
Driver64       = /usr/lib64/libmyodbc5.so
Setup64        = /usr/lib64/libodbcmyS.so
FileUsage      = 1
[root@localhost ~]#

The odbc.ini file is another one that may need to be configured. It is also found in /etc. Make sure all the information there is correct. The database should match the database you are trying to connect to. Here's an example of what this file should look like, but check to make sure it is correct for your system.

[root@localhost ~]# cat /etc/odbc.ini
[mysql]
Description     = mysql
Driver          = mysql
Server          = localhost
Database        = test
Port            =
Socket          =
Option          =
Stmt            =
[root@localhost ~]#

Configuring appx.env

The appx.env file needs to be configured to point APPX to the 32-bit MySQL ODBC Connector drivers. I didn't have to make any changes to this file when I installed the connector using the package manager. The line beginning with APPX_ODBC_LIB should contain the path to the 32-bit connector driver. It should look something like this:

APPX_ODBC_LIB=/usr/lib/libmyodbc5.so

64-Bit Red Hat/Scientific Linux/Oracle Linux 6

APPX can connect to 64-bit MySQL using 32-bit ODBC connector drivers and some 32-bit libraries that can be installed through the package manager.

Installing MySQL

MySQL can be installed with yum by installing the following packages:

mysql.x86_64 : MySQL client programs and shared libraries
mysql-server.x86_64 : The MySQL server and related files

Installing unixODBC

UnixODBC can also be installed using yum by installing the following packages:

unixODBC.i686 : A complete ODBC driver manager for Linux
mysql-connector-odbc.i686 : ODBC driver for MySQL

Installing the ODBC Connectors

The 32-bit connectors might not be included in the repository. If they are not there, they can be installed with: (You may want to modify this link to match your distro. I was running Scientific Linux 6, so I went to Scientific Linux's site and found the package there.)

yum install http://ftp1.scientificlinux.org/linux/scientific/6.0/i386/os/Packages/mysql-connector-odbc-5.1.5r1144-7.el6.i686.rpm

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. I didn't need to make any changes to this file, but if you are unable to connect, make sure the path to the 32-bit driver is correct.

[root@localhost etc]# cat odbcinst.ini
# Example driver definitions


# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description     = ODBC for MySQL
Driver          = /usr/lib/libmyodbc5.so
Setup           = /usr/lib/libodbcmyS.so
#Driver64       = /usr/lib64/libmyodbc5.so
#Setup64        = /usr/lib64/libodbcmyS.so
FileUsage       = 1
[root@localhost etc]#

The odbc.ini file is another one that may need to be configured. It is also found in /etc. Make sure all the information there is correct. The database should match the database you are trying to connect to. Here's an example of what this file should look like, but check to make sure it is correct for your system.

[root@localhost etc]# cat odbc.ini
[mysql]
Description     = mysql
Driver          = mysql
Server          = localhost
Database        = test
Port            =
Socket          =
Option          =
Stmt            =
[root@localhost etc]#

Configuring appx.env

The appx.env file needs to be configured to point APPX to the 32-bit MySQL ODBC Connector drivers. I didn't have to make any changes to this file when I installed the 32-bit connector using the package manager. The line beginning with APPX_ODBC_LIB should contain the path to the 32-bit connector driver. Here is an example, but the path may be different for your system.

APPX_ODBC_LIB=/usr/lib/libmyodbc5.so

Additional 32-bit Libraries

Because APPX is 32-bit, it will need some libraries that aren't found in 64-bit Red Hat by default. They can all be installed through the package manager. APPX will need the glibc, zlib, and libgcc libraries.

yum install glibc-2.12-1.7.el6_0.5.i686 zlib-1.2.3-25.el6.i686 libgcc.i686

Testing/Troubleshooting

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@localhost ~]# 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@localhost ~]# file /usr/bin/isql
/usr/bin/isql: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

If it looks like this(ELF 64-bit), you will need to get the 32-bit version:

[root@localhost ~]# file /usr/bin/isql
/usr/bin/isql: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

A positive test using ISQL should result in something like this:

[root@localhost ~]# isql mysql
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL>

Comments:

Read what other users have said about this page or add your own comments.



Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2016-02-12 - JeanNeron
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback