找不到ODBC数据源名称,并且未指定默认驱动程序

时间:2018-11-13 00:50:09

标签: odbc

(环境是Linux CentOs7)

每次更改时,我都会摆弄odbc.ini文件并测试连接:

isql -v gdHive
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

在odbc.ini文件中,我一直在尝试描述名称/值对的不同变体。最初设置为:

# Description: DSN Description.
Description=Hortonworks Hive ODBC Driver (64-bit) DSN

我尝试将其更改为

Description=gdHive

这并没有改变我上面粘贴的错误。

这是整个配置,这是我第一次设置,因此我不确定我错过了什么:

# HS2 service discovery with ZooKeeper (ServiceDiscoveryMode=1).
ZKNamespace=/hive/hiveserver2

# Set to 1 if you are connecting to Hive Server 1. Set to 2 if you are connecting to Hive Server 2.
HiveServerType=2

# The authentication mechanism to use for the connection.
#   Set to 0 for No Authentication
#   Set to 1 for Kerberos
#   Set to 2 for User Name
#   Set to 3 for User Name and Password
# Note only No Authentication is supported when connecting to Hive Server 1.
AuthMech=1

# The Thrift transport to use for the connection.
#       Set to 0 for Binary
#       Set to 1 for SASL
#       Set to 2 for HTTP
# Note for Hive Server 1 only Binary can be used.
ThriftTransport=1

# When this option is enabled (1), the driver does not transform the queries emitted by an
# application, so the native query is used.
# When this option is disabled (0), the driver transforms the queries emitted by an application and
# converts them into an equivalent from in HiveQL.
UseNativeQuery=0

# Set the UID with the user name to use to access Hive when using AuthMech 2 to 8.
UID=

# The following is settings used when using Kerberos authentication (AuthMech 1 and 10)

# The fully qualified host name part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
#   hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbHostFQDN to myhs2.mydomain.com
KrbHostFQDN=hive.hadoop.p3.int.example.com

# The service name part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
#   hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbServiceName to hive
KrbServiceName=hive

# The realm part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
#   hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbRealm to EXAMPLE.COM
KrbRealm=HADOOP.PROD.INT.EXAMPLE.COM

# Set to 1 to enable SSL. Set to 0 to disable.
SSL=0

# Set to 1 to enable two-way SSL. Set to 0 to disable. You must enable SSL in order to
# use two-way SSL.
TwoWaySSL=0

# The file containing the client certificate in PEM format. This is required when using two-way SSL.
ClientCert=

# The client private key. This is used for two-way SSL authentication.
ClientPrivateKey=

# The password for the client private key. Password is only required for password protected
# client private key.
ClientPrivateKeyPassword=

错误消息仅显示“找不到数据源名称,并且未指定默认驱动程序”。我不确定如何设置此数据源名称或选择默认驱动程序?

1 个答案:

答案 0 :(得分:0)

Description”关键字的值在ODBC DSN中完全是修饰性的。它没有功能用途。您可以将其设置为任意字符串。

通过黑暗中的反复试验很难学习ODBC。建议您看看official ODBC specification。您可能还会在您的环境中查看驱动程序管理器的一些文档,例如this for iODBCthis for unixODBC