[IM002][unixODBC][Driver Manager]Data source name

2019-05-30 03:47发布

问题:

I'm trying to install ODBC on Ubuntu 12.04 for the purpose of using it with Zabbix. I installed unixODBC as per these Zabbix instructions and modified my /etc/odbc.ini to look like this:

[eyatest]
Description           = MySQL connection to 'dbname' database
Driver                = MySQL
Database              = dbname
Server                = localhost
UserName              = root
Password              = ****
Port                  = 3306
Socket                = /var/lib/mysql/mysql.sock

But when I try connecting with isql I get the error in the title of this question:

sudo isql -v eyatest

[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified

What am I missing?

EDIT: My /etc/odbcinst.ini looks like this:

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
FileUsage = 1

When I do odbcinst -j I get the following:

unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/eyal/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8