I wanted to see how easy it was to access a MySQL database from UniVerse; using UniVerse as the client.

This is on Linux (CentOS 4) with UniVerse 10.2 PE.

I first had to install the MySQL odbc driver. This is called a connector, Connector/ODBC, to be exact. I used the Linux x86 generic RPM driver 3.51.21-0.

That installed OK. Then it is necessary to obtain an odbc manager. This piece of software manages the connection between the client (UniVerse) and the odbc database driver. Most people have used the odbc manager within the MS-Windows control panel, where a database connection is named, along with the appropriate database driver is selected; this does the same thing.

This is the tricky part, as there are a number of commercial versions available and not many open source versions. I currently am trying unixODBC, version 2.2.11.

Once I had installed the manager, I used the ODBCConfig gui utility to create a database connection to the MySQL test database. I did have to add a SOCKET parameter to the odbc.ini file under the MYSQL entry. It seems to want to use /tmp for the socket file, so I added:

SOCKET          = /var/lib/mysql/mysql.sock

I tested all the setup and connections using the isql utility which is supplied with the MySQL odbc programs. All OK.

Then I attempted to use the UniVerse CONNECT command at ECL to connect to the odbc connection. No go – it would not connect. I spent some time on this, attempting to understand why UniVerse would not connect.

Eventually, I went back and re-read the BCI manual. I had skipped the dll relinking procedure, so UniVerse can find the odbc dll. So a relink.uvlibs solved the problem.

I can now access a test MySQL database from within UniVerse using the CONNECT verb. But, not all is perfect yet. If I type in an incorrect sql command, CONNECT aborts, taking the UniVerse runtime with it, and I end up back at the Linux shell level or being logged off.

I have to investigate this…