[unixODBC][Driver Manager]Can't open lib


Persistently facing the error: WARNING[51358] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can’t open lib ‘/usr/local/lib/libmyodbc8a.so’ : file not found

Other tests return a success as attached. This is Asterisk 20.4.0 on Ubuntu 22.04.



What would be the misconfig?

“Can’t open lib ‘/usr/local/lib/libmyodbc8a.so’ : file not found”

“What would be the misconfig?”

Well, either you have not installed the MySQL ODBC driver, or you’ve installed
it elsewhere and need to put the correct path to it into odbcinst.ini

For info, on my Debian system the MariaDB equivalent driver is in


Maybe the paths issue: Definitely not here: /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so I checked. How would I confirm the paths are ok?

@jcolp Oops, I notice that should have asked in Asterisk Support forum. Your input?

“Definitely not here:

Well, you certainly would not have that one, because I’m using MariaDB and
you’re using MySQL.

I suggest you try:

a) find / -name libmyodbc8a.so

  • that will tell you where it is, if it is installed

b) https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation-

  • that will tell you how to install it if you haven’t already


root@databranch:~# find / -name libmyodbc8a.so

There it is…I have installed this package severally.

@penguinpbx Any word? Am stuck here for long.

Never used database features, and the general rule is that you don’t tag to request replies, as people will provide anything they can and want to provide without being prompted.

1 Like

You have another suggestion this thing is really holding my progress back…

I am unable to reconcile your error message:

“Can’t open lib ‘/usr/local/lib/libmyodbc8a.so’ : file not found”

with your output from the find command:

root@databranch:~# find / -name libmyodbc8a.so

Unless there is some bizarre permissons problem in the directories leading
down to where that file is, I can’t see why ODBC is unable to open it.

Have you reviewed https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-
installation-binary-deb.html to make sure you installed the driver correctly?


Debian 12 driver for MARIA should work out-of-the-box. Please see this relevant part of a related Ansible role (installs the off-topic FreePBX GUI with MARIA/MYSQL on Asterisk 20 on Debian 12):