安装驱动程序管理器Installing the Driver Manager

下载下载 ODBC 驱动程序DownloadDownload ODBC Driver

本主题包含若要使用 Microsoft ODBC Driver 11、 13 或 13.1 for SQL Server 在 Linux 和 macOS 上安装 unixODBC 驱动程序管理器使用的说明。This topic contains instructions to install the unixODBC Driver Manager for use with Microsoft ODBC Driver 11, 13, or 13.1 for SQL Server on Linux and macOS.

重要

在安装 unixODBC 驱动程序管理器之前,删除安装在计算机上的任何驱动程序管理器包。Delete any driver manager packages installed on your computer before you install the unixODBC Driver Manager. 安装 unixODBC 驱动程序管理器可能会导致现有驱动程序管理器出现故障。Installing the unixODBC Driver Manager could cause a failure of an existing Driver Manager.

安装 Microsoft ODBC 驱动程序为 13.0 和 13.1 驱动程序管理器Installing the Driver Manager for Microsoft ODBC Driver 13.0 and 13.1

包管理系统的自动得到解决你安装 Microsoft ODBC 驱动程序为 13.0 或 13.1 for SQL Server 上 Linux 或 macOS 按照中的说明驱动程序管理器依赖关系安装 Microsoft ODBC 驱动程序有关在 Linux 或 macOS 上的 SQL ServerThe driver manager dependency is resolved automatically by the package management system when you install the Microsoft ODBC Driver 13.0 or 13.1 for SQL Server on Linux or macOS by following the instructions in Installing the Microsoft ODBC Driver for SQL Server on Linux or macOS.

为 Microsoft ODBC Driver 11 for SQL Server 安装驱动程序管理器Installing the Driver Manager for Microsoft ODBC Driver 11 for SQL Server

(SUSE 和仅限 Red Hat Linux。)(SUSE and Red Hat Linux only.)

使用安装脚本Using the Installation Script

重要

这些说明是指msodbcsql-11.0.2270.0.tar.gz,即 Red Hat Linux 的安装文件。These instructions refer to msodbcsql-11.0.2270.0.tar.gz, which is the installation file for Red Hat Linux. 如果你要安装适用于 SUSE Linux 预览,文件名是msodbcsql-11.0.2260.0.tar.gzIf you are installing the Preview for SUSE Linux, the file name is msodbcsql-11.0.2260.0.tar.gz.

若要安装驱动程序管理器:To install the driver manager:

  1. 请确保具有根权限。Make sure that you have root permission.

  2. 转到目录其中 MicrosoftMicrosoft SQL ServerSQL Server ODBC 驱动程序下载放置的文件称为msodbcsql-11.0.2270.0.tar.gzGo to the directory where the MicrosoftMicrosoft SQL ServerSQL Server ODBC Driver download placed the file called msodbcsql-11.0.2270.0.tar.gz. 确保所拥有的 *.tar.gz 文件与你的 Linux 版本匹配。Make sure that you have the *.tar.gz file that matches your version of Linux. 若要提取的文件,请执行以下命令: tar xvzf msodbcsql 11.0.2270.0.tar.gzTo extract the files, execute the following command: tar xvzf msodbcsql-11.0.2270.0.tar.gz.

  3. 将更改为msodbcsql-11.0.2270.0目录,你应该看到名为的文件的存在build_dm.shChange to the msodbcsql-11.0.2270.0 directory and there you should see a file called build_dm.sh. 你可以运行build_dm.sh安装 unixODBC 驱动程序管理器。You can run build_dm.sh to install the unixODBC Driver Manager.

  4. 若要查看可用选项的列表,请执行以下命令: ./build_dm.sh-帮助To see a list of the available options, execute the following command: ./build_dm.sh --help.

  5. 当你准备好安装,并且如果你的计算机可以访问外部站点通过 FTP,执行以下命令: ./build_dm.shWhen you are ready to install, and if your computer can access an external site via FTP, execute the following command: ./build_dm.sh.

如果你的计算机无法访问外部站点通过 FTP,获取unixODBC-2.3.0.tar.gzIf your computer cannot access an external site via FTP, get unixODBC-2.3.0.tar.gz. 你可以获取unixODBC-2.3.0.tar.gzhttp://www.unixodbc.org。单击下载页后,可以转到下载页面左侧的链接。You can get unixODBC-2.3.0.tar.gz from http://www.unixodbc.org. Click the Download link on the left side of the page to go to the download page. 然后,单击相应链接以下载 unixODBC-2.3.0(而非 unixODBC-2.3.1)。Then click the appropriate link to download unixODBC-2.3.0 (not unixODBC-2.3.1). 此版本的不支持 unixODBC 2.3.1 MicrosoftMicrosoft ODBC Driver 11 for SQL ServerSQL ServerunixODBC-2.3.1 is not supported with this release of the MicrosoftMicrosoft ODBC Driver 11 for SQL ServerSQL Server. 执行以下命令以开始 unixODBC 驱动程序管理器安装: ./build_dm.sh-下载 url = file://unixODBC-2.3.0.tar.gzExecute the following command to begin the unixODBC Driver Manager installation: ./build_dm.sh --download-url=file://unixODBC-2.3.0.tar.gz.

  1. 类型继续进行解压缩文件。Type YES to proceed with unpacking the files. 完成这部分过程最多需要 5 分钟。This part of the process can take up to 5 minutes to complete.

  2. 该脚本停止运行后,按照屏幕上的说明来安装 unixODBC 驱动程序管理器。After the script stops running, follow the instructions on the screen to install the unixODBC Driver Manager.

现在可以随时安装该驱动程序。You are now ready to install the driver. 请参阅安装 Microsoft ODBC Driver for SQL Server 在 Linux 和 macOS 上有关详细信息。See Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS for more information.

手动安装Manual Installation

如果无法完成安装脚本,请自行配置并生成合适的驱动程序管理器。If the installation script is unable to complete, configure and build the proper driver manager yourself.

  1. 删除所有已安装的旧版 unixODBC(例如 unixODBC 2.2.11)。Remove any older installed version of unixODBC (for example, unixODBC 2.2.11). 在 Red Hat Enterprise Linux 5 或 6 上,执行以下命令: yum 删除 unixODBCOn Red Hat Enterprise Linux 5 or 6, execute the following command: yum remove unixODBC. SUSE Linux Enterprise 上zypper 删除 unixODBCOn SUSE Linux Enterprise, zypper remove unixODBC.

  2. 转到http://www.unixodbc.org。单击下载页后,可以转到下载页面左侧的链接。Go to http://www.unixodbc.org. Click the Download link on the left side of the page to go to the download page. 然后,单击相应链接以将文件 unixODBC-2.3.0.tar.gz 保存到计算机。Then click the appropriate link to save the file unixODBC-2.3.0.tar.gz to your computer. 此版本的不支持 UnixODBC 2.3.1 MicrosoftMicrosoft ODBC Driver 11 for SQL ServerSQL ServerUnixODBC-2.3.1 is not supported with this release of the MicrosoftMicrosoft ODBC Driver 11 for SQL ServerSQL Server.

  3. 在你的 Linux 计算机上执行该命令: tar xvzf unixODBC 2.3.0.tar.gzOn your Linux computer, execute the command: tar xvzf unixODBC-2.3.0.tar.gz.

  4. 转到 unixODBC-2.3.0 目录。Change to the unixODBC-2.3.0 directory.

  5. 在命令提示符下执行命令: CPPFLAGS ="-DSIZEOF_LONG_INT = 8"At a command prompt, execute the command: CPPFLAGS="-DSIZEOF_LONG_INT=8".

  6. 在命令提示符下执行命令:导出 CPPFLAGSAt a command prompt, execute the command: export CPPFLAGS.

  7. 在命令提示符下执行命令: "。 / 配置-前缀 = / usr-libdir = / usr/lib64-sysconfdir = / 等-启用 gui = 否 — 启用驱动程序 = 否 — 启用 iconv-与-iconv-char-enc = UTF8-与-iconv-ucode-enc = UTF16LE".At a command prompt, execute the command: "./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --enable-gui=no --enable-drivers=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE".

  8. 在命令提示符,(root 登录),执行该命令:使At a command prompt (logged in as root), execute the command: make.

  9. 在命令提示符,(root 登录),执行该命令:使安装At a command prompt (logged in as root), execute the command: make install.

现在可以随时安装该驱动程序。You are now ready to install the driver. 请参阅安装 Microsoft ODBC Driver for SQL Server 在 Linux 和 macOS 上有关详细信息。See Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS for more information.

另请参阅See Also

安装 Microsoft ODBC Driver for SQL Server 在 Linux 和 macOS 上Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS

此版本驱动程序中的已知问题Known Issues in this Version of the Driver

发行说明Release Notes