您好,我想使用python库pyhive和pyodbc连接到hive:
conn = hive.Connection(host="hostname",port=10001,username="********",database="default",auth='KERBEROS',kerberos_service_name="hive")我得到的错误
TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'当我使用pyodbc时,
conn_string="""DSN=%s; Host=%s, Port=%d, Database=default; AuthMech=3;UseSASL=1; UID=%s; PWD=%s; SSL=1;AllowSelfSignedServerCert=1"""% (cfg['DSN'], cfg['host'], cfg['port'],cfg['username'], cfg['password'])
conn = pyodbc.connect(conn_string, autocommit=True)这是我得到的错误,所以如果任何人已经成功地通过pyodbc连接python和hive,pyhive请帮助
Hive托管在Cloudera中。
发布于 2020-05-11 14:53:41
pyhive需要sasl依赖项
在linux上通过yum/apt安装
在windows上安装cyrus-sasl包后,需要配置sasl2目录
已找到site-packages/sasl或Library/bin/
方法一:将sasl2文件夹复制到C:\CMU\bin\
方法二:添加注册表字符串
HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL Library\SearchPath
C:\Users\cdarling\Miniconda3\envs\hive\Library\bin\sasl2https://stackoverflow.com/questions/53433446
复制相似问题