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

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

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

Postby vitormazuco » Thu Dec 10, 2015 9:35 am

Hi!

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


But it returns for me this error

Code: Select all
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!
vitormazuco
Oldsterisk
 
Posts: 51
Joined: Mon Mar 02, 2015 11:37 am
Location: São Paulo, Brazil

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

Postby ambiorixg12 » Thu Dec 10, 2015 11:23 am

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

http://asteriskdocs.org/en/3rd_Edition/ ... _odbc.html
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

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

Postby mkozusnik » Fri Dec 11, 2015 10:22 pm

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:
Code: Select all
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:
Code: Select all
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
mkozusnik
Newsterisk
 
Posts: 45
Joined: Fri Nov 13, 2015 8:31 am
Location: Wheeling, WV

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

Postby vitormazuco » Mon Dec 14, 2015 6:34 am

Yes, I fix it install the source

Code: Select all
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
vitormazuco
Oldsterisk
 
Posts: 51
Joined: Mon Mar 02, 2015 11:37 am
Location: São Paulo, Brazil


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest