6
votes

I install that:

sudo apt-get install unixodbc unixodbc-dev

I download mariadb-connector-odbc-3.0.2-ga-debian-x86_64.tar.gz from here https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.0.2/ and copy libmaodbc.so from archive to /usr/lib/x86_64-linux-gnu/odbc/

Next I configure odbcinst.ini:

[MariaDB]
Description=MariaDB
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so   
Setup=/usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so 
FileUsage=1

and next odbc.ini:

[ast-con]
Description           = MariaDB connection to 'asterisk' database
Driver                = MariaODBC
Database              = AsteriskDB
Server                = localhost
UserName              = zk
Password              = rt131cvn
Port                  = 3306
Socket                = /var/run/mysqld/mysqld.sock

Command:

root@asterisk:/etc# odbcinst -q -d
[MariaODBC]

Next I try to check odbc with isql:

root@asterisk:/etc# isql -v ast-con
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so   # latest stable from https://downloads.mariadb.org/connector-odbc/+releases/' : file not found
[ISQL]ERROR: Could not SQLConnect

I try search google, and find 1 solution, but it doesn't help:

I set LD_LIBRARY_PATH

root@asterisk:/etc# env
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/odbc
SSH_CONNECTION=xx.xxx.xxx.xxx 64759 xx.xxx.xxx.xx 22
OLDPWD=/root
XDG_SESSION_ID=26153
USER=root
PWD=/etc
HOME=/root
SSH_CLIENT=xx.xxx.xxx.xxx 64759 22
SSH_TTY=/dev/pts/0
MAIL=/var/mail/root
TERM=xterm
SHELL=/bin/bash
SHLVL=1
LOGNAME=root
XDG_RUNTIME_DIR=/run/user/0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env

Next command:

root@asterisk:/etc# ldd /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
        linux-vdso.so.1 (0x00007fffad26f000)
        libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007f5ad171d000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5ad1419000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5ad107a000)
        libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f5ad0e6e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5ad0c51000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5ad1be9000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5ad0a4d000)

Usually there is libodbcinst.so.1 => not found and then exec something like this: ln -s libodbcinst.so.1 libodbcinst.so.2.0.0

but my result is different, and I can not to understand what should I do ? Help please!

3
Are you following the same instructions? I'm running into the same issue right now with this powerpbx.org/content/…Dmitri DB
Yes, the same instructions, and the same result.Morph

3 Answers

5
votes

This is very annoying and I've narrowed it down to a few things:

  • If you follow the instructions, Debian will be installing libssl-dev for you, however libmaodbc.so is linked to libssl.so.1.0.0 and libcrypto.so.1.0.0 -- therefore it will encounter ENOENT (No such file or directory) when trying to find these two .so, hence throwing out "file not found" error (doing an strace on the command will provide you with details that it has found the libmaodbc.so file, but not the two other files)

  • Even if you do manage to get libssl1.0-dev it will remove other packages that are required for FreePBX/Asterisk.

  • Even then, it will still fail on libc.mo searching for locales en_US

The solution to this is to find another libmaodbc.so that is linked properly against libssl1.1

2
votes

i have same problem, try older driver version eg /mariadb-connector-odbc-2.0.15-ga-debian-x86_64 work for me!

-1
votes

Just load the lib fron debian site and isntall it manually!