Can't open lib '/usr/lib/odbc/'


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/' : 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

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


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

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

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

mark@mark ~ $ more /etc/odbc.ini 
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 
Description	= ODBC for MySQL
Driver		= /usr/lib/x86_64-linux-gnu/odbc/		
Setup		= /usr/lib/x86_64-linux-gnu/odbc/
FileUsage	= 1

Yes, I fix it install the source

svn co svn:// unixodbc
cd /unixodbc
make -f Makefile.svn 
make install 

Is better install in this way.


1 Like