linuxubuntumariadbodbcunixodbc

Ubuntu 6.2 and MariaDB ODBC Error Can't open lib '/usr/lib64/libmaodbc.so' : file not found


Receiving the below error message when trying to connect to MariaDB using ODBC connection on Ubuntu 6.2 OS. I've tried just about everything but it's not working

Error:

Can't open lib '/usr/lib64/libmaodbc.so' : file not found

Operating System:

Linux ubuntu 6.2.0-1013-raspi #15-Ubuntu SMP PREEMPT Fri Sep  8 18:53:11 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

File Permissions:

root@ubuntu:/usr/lib64# ls -l
total 2316
-rwxrwxrwx 1 root root 2365512 Sep 24 19:07 libmaodbc.so

Information on Libmaodbc.so file:

readelf -l /usr/lib64/libmaodbc.so

Elf file type is DYN (Shared object file)
Entry point 0x172d0
There are 7 program headers, starting at offset 64

ODBC Setup:

odbcinst -j
unixODBC 2.3.11
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

cat /etc/odbcinst.ini
[MariaDB]
Description=MariaDB
Driver=/usr/lib64/libmaodbc.so
UsageCount=4

Testing:

isql -v -k "DRIVER={MariaDB};127.0.0.1;UID=admin;PWD=password"
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmaodbc.so' : file not found
[ISQL]ERROR: Could not SQLDriverConnect

Solution

  • Resolved the problem by installing the correct architecture of the ODBC driver onto the system. I'm running ubuntu on a aarch64 system, so I installed the aarch version of the ODBC drivers and not use the 64bit version.