David J Murray Dev
~ Learn and Do - Excel and Share ~

UniVerse odbc to MySQL

Oct 8, 2007
You're Reading: UniVerse odbc to MySQL

A post in Code & MVDBS & MySQL & ODBC & Techniques & U2 SQL & UniVerse

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…

About the Author

<a href="https://davidjmurray.dev/losucag/davidjmurray/" target="_self">djm</a>


I have been in the computer/IT industry for over 35 years. After spending half a life-time in highly proprietary database environments, I have succumbed to the WordPress Eco-system and I'm well down the chasm. I am specializing in AWS hosting, Wordpress CMS, Elegant Themes, in particular Divi and Extra themes.


Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This