在vmware里用Ubuntu16的虚拟机连接数据库,提示这样的报错,请问该怎么解决?

在vmware里用Ubuntu16的虚拟机连接数据库,提示error in get DataBaseHander():(pyodbc.OperationalError)('08S01,'[08S01]'[unixODBC][FreeTDS ][SQL Server]Unable to connect:Adaptive Server is unavailable or does not exist(20009)(SQLDriverConnect)')(background on this error at:http://sqlalche.me/e/13/e3q8) 之前一直是好的,进行了一次硬盘分盘、虚拟机克隆、克隆文件通过网线两台电脑传输的过程就这样了。

此错误表明构建docker映像时缺少ODBC驱动程序。我遇到了同样的问题,并通过明确提供安装Linux ODBC驱动程序的说明解决了同样的问题。

在您的docker文件中编写以下指令以使其正常工作:
-===================================== =
RUN apt-get安装curl
RUN apt-get安装apt-transport-https
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt键添加-
运行curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | 发球/etc/apt/sources.list.d/msprod.list

RUN apt-get update
ENV ACCEPT_EULA = y DEBIAN_FRONTEND =非交互式
RUN apt-get install mssql-tools unixodbc-dev -y