如何使用Zabbix上的unixODBC连接到ODBC DSN ?

时间:2023-02-06 06:41:19

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

我安装了unixODBC和MySql ODBC驱动程序,但不能连接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?

我应该做什么?

1 个解决方案

#1


0  

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

应该显示到您的*.ini文件路径吗

#1


0  

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

应该显示到您的*.ini文件路径吗