Asterisk 1.8 > ODBC mysql connection issues


I am having some issues with the ODBC connection to a mysql database from within asterisk. The trouble is, in all the tutorials people say if isql is working, asterisk should work.

This is not the case on my setup.

I have unixodbc - iodbc and mysql5 with the mysql-connector installed.

This is the odbc.ini file:

The odbcinst.ini file is:

My res_odbc.conf is:
enabled => yes
dsn => MySQL-asterisk
username => asterisk
password => XXXXXXXXX
preconnect => yes

IF i run the command : isql -v MySQL-asterisk … It connects just fine. I can run queries on the database.

When i start asterisk it shows the following in the log:

NOTICE[2829] res_odbc.c: Registered ODBC class ‘asterisk’ dsn->[MySQL-asterisk]
NOTICE[2829] res_odbc.c: res_odbc loaded.
NOTICE[2829] config.c: Registered Config Engine odbc

But it wont connect , the response from odbc show is:

ODBC DSN Settings

Name: asterisk
DSN: MySQL-asterisk
Last connection attempt: 1970-01-01 01:00:00

If asterisk tries to read from the database i get this error :
[Apr 26 14:47:53] WARNING[2898] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=-1248415568 [iODBC][Driver Manager]/usr/local/lib/ undefined symbol: dynstr_append_mem

That is the same error that i get when i use iodbctest …

I hope someone can explain me what it is going on. Every tutorial i read says that if isql works that asterisk odbc connection should work also… But it doesn’t …

Thank you,
With kind regards,

Never mind … I got it … I had to install myodbc 3 instead of 5 …

thanks for reading …