Can't open lib '/usr/lib/odbc/libmyodbc.so'

Hi!

I try to verify that if I can connect MySQL database using the isql application using echo "select 1" | isql -v asterisk-connector asterisk

But it returns for me this error

root@cdr-stats:/usr/src# echo "select 1" | isql -v asterisk-connector
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/odbc/libmyodbc.so' : file not found
[ISQL]ERROR: Could not SQLConnect

Resume the story, I’m trying to link the Asterisk 11 to my CDR asterisk-cdr-viewer https://github.com/g613/asterisk-cdr-viewer

But make this ODBC connector in Asterisk, is very confused.

Thanks!

Before you install the connector in Asterisk, you have to install ODBC into Linux itself. To install the ODBC drivers, Follow this guide

asteriskdocs.org/en/3rd_Edition/ … _odbc.html

Did you look to see if this file exists “/usr/lib/odbc/libmyodbc.so”?

If you’re running a 64-bit OS, the odbc.ini will look like this:

mark@mark ~ $ more /etc/odbc.ini 
[asterisk-connector]
Description     = MySQL connection to 'asterisk' database
Driver          = MySQL
Database        = asterisk
Server          = localhost
Port            = 3306
Socket          = /var/run/mysqld/mysqld.sock

And the odbcinst.ini will look like this:

mark@mark ~ $ more /etc/odbcinst.ini 
[MySQL]
Description	= ODBC for MySQL
Driver		= /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so		
Setup		= /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage	= 1

Yes, I fix it install the source

svn co svn://svn.code.sf.net/p/unixodbc/code/trunk unixodbc
cd /unixodbc
make -f Makefile.svn 
./configure
make 
make install 

Is better install in this way.

Thanks

1 Like