通过SQL炼金术错误连接到Exasol DB



我试图通过SQL Alchemy

连接到Exasol DB

我使用:

安装了SQL炼金术
pip install sqlalchemy-exasol

代码如下:

from sqlalchemy import create_engine
e = create_engine("exa+pyodbc://<user>:<password>@<host>:<port>/<schema>?CONNECTIONLCALL=en_US.UTF-8&driver=com.exasol.jdbc.EXADriver")
e.execute("Select count(*) from TableA").fetchall()

我也尝试过:

  e = create_engine("exa+pyodbc://<user>:<password>@<host>:<port>/<schema>")

无论哪种方式,我都会收到以下错误:

Traceback (most recent call last):
  File "C:UsersxxxAppDataLocalContinuumAnaconda3libsite-packagessqlalchemypool.py", line 1122, in _do_get
    return self._pool.get(wait, self._timeout)
  File "C:UsersxxAppDataLocalContinuumAnaconda3libsite-packagessqlalchemyutilqueue.py", line 145, in get
    raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

有什么想法吗?我的连接细节格式一定有问题,但我不确定什么...

错误消息听起来像ODBC驱动程序DNS未正确配置。安装ODBC驱动程序。

相关内容

  • 没有找到相关文章

最新更新