RetiZi
RetiZi

Reputation: 19

How to connect to ODBC DSN with unixODBC on Zabbix?

I installed unixODBC and MySql ODBC driver, but can not to connect ODBC DNS.

isql -v myodbc_mysql_dsn

I got this error :

Cannot connect to ODBC DSN:
[SQL ERROR]:[IM002][0][[unixODBC][Driver Manager]Data source name not found, and no default driver specified]|

my configration looks like this:

cat /etc/odbc.ini
[myodbc_mysql_dsn]
Description = test
Driver      = MySQL5                 # custom driver name
Server      = localhost                    # or external IP if needed
Port        = 3306                         # or custom port if needed
Socket      = /var/run/mysqld/mysqld.sock  # socket, see above
Database    = zabbix                     # MySQL DB name or empty
Option      = 3
ReadOnly    = No
cat /etc/odbcinst.ini
[MySQL5]
Description = ODBC for MySQL
Driver      = /usr/lib/odbc/libmyodbc5.so
Setup       = /usr/lib/odbc/libodbcmyS.so
#Driver     = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
#Setup      = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage   = 1 
UsageCount = 2 '

What should I do?

Upvotes: 1

Views: 5691

Answers (1)

ufaowl
ufaowl

Reputation: 11

Here are some tips: Use:

odbcinst -q -s

to see if you driver sees your datasources

Then

odbcinst -j

should show you filepaths to your *.ini

Upvotes: 1

Related Questions