bcp
和 sqlcmd
)以及 unixODBC 开发标头的说明。It also includes instructions for the optional command-line tools for SQL Server (bcp
and sqlcmd
) and the unixODBC development headers.msodbcsql
包,应先删除它,再安装 msodbcsql17
包。If you installed the v17 msodbcsql
package that was briefly available, you should remove it before installing the msodbcsql17
package.这样可避免冲突。This will avoid conflicts.msodbcsql17
包可以与 msodbcsql
v13 包并行安装。The msodbcsql17
package can be installed side by side with the msodbcsql
v13 package.echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections
You can substitute setting the environment variable 'ACCEPT_EULA' with setting the debconf variable 'msodbcsql/ACCEPT_EULA' instead: echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections
echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections
You can substitute setting the environment variable 'ACCEPT_EULA' with setting the debconf variable 'msodbcsql/ACCEPT_EULA' instead: echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections
glibc, e2fsprogs, krb5-libs, openssl, unixODBC
Red Hat: glibc, e2fsprogs, krb5-libs, openssl, unixODBC
glibc, libuuid1, krb5, openssl, unixODBC
SUSE: glibc, libuuid1, krb5, openssl, unixODBC
msodbcsql``.rpm
下载最新的 https://packages.microsoft.com/rhel/7/prod/ 。Download the latest msodbcsql
.rpm
from https://packages.microsoft.com/rhel/7/prod/.msodbcsql``.deb
下载最新的 https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql/ 。Download the latest msodbcsql
.deb
from https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql/.msodbcsql``.rpm
下载最新的 https://packages.microsoft.com/sles/12/prod/ 。Download the latest msodbcsql
.rpm
from https://packages.microsoft.com/sles/12/prod/.msodbcsql-11.0.2270.0.tar.gz
。These instructions refer to msodbcsql-11.0.2270.0.tar.gz
, which is installation file for Red Hat Linux.如果要安装适用于 SUSE Linux 的预览版,则文件名为 msodbcsql-11.0.2260.0.tar.gz
。If you are installing the Preview for SUSE Linux, the file name is msodbcsql-11.0.2260.0.tar.gz
.msodbcsql-11.0.2270.0.tar.gz
的目录。Change to the directory where the download placed the file 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.gz
。To extract the files, execute the following command, tar xvzf msodbcsql-11.0.2270.0.tar.gz
.msodbcsql-11.0.2270.0
目录,你应在此处看到一个名为 install.sh 的文件 。Change to the msodbcsql-11.0.2270.0
directory and there you should see a file called install.sh.odbc_config --odbcinstini
。To discover the location of odbcinst.ini on your computer, execute the following command: odbc_config --odbcinstini
../install.sh verify
。Before you install the driver, execute the following command: ./install.sh verify
../install.sh verify
告的输出会报计算机中是否具有在 Linux 上支持 ODBC 驱动程序所需的软件。The output of ./install.sh verify
reports if your computer has the required software to support the ODBC driver on Linux../install.sh install
。When you are ready to install the ODBC driver on Linux, execute the command: ./install.sh install
.如果需要指定安装命令(bin-dir
或 lib-dir
),请在“安装”选项后指定该命令 。If you need to specify an install command (bin-dir
or lib-dir
), specify the command after the install option./opt/microsoft/msodbcsql/11.0.2270.0
中。Installation puts the driver in /opt/microsoft/msodbcsql/11.0.2270.0
.驱动程序及其支持文件必须位于 /opt/microsoft/msodbcsql/11.0.2270.0
中。The driver and its support files must be in /opt/microsoft/msodbcsql/11.0.2270.0
.odbcinst -q -d -n 'ODBC Driver 11 for SQL Server'
。To verify that the Microsoft ODBC driver on Linux was registered successfully, execute the following command: odbcinst -q -d -n 'ODBC Driver 11 for SQL Server'
.rm -f /usr/bin/sqlcmd
rm -f /usr/bin/bcp
rm -rf /opt/microsoft/msodbcsql
odbcinst -u -d -n 'ODBC Driver 11 for SQL Server'
组件Component | 说明Description |
---|---|
libmsodbcsql-17.X.so.X.X 或 libmsodbcsql-13.X.so.X.Xlibmsodbcsql-17.X.so.X.X or libmsodbcsql-13.X.so.X.X | 包含该驱动程序所有功能的共享对象 (so ) 动态库文件。The shared object (so ) dynamic library file that contains all of the driver's functionality.此文件安装在 ODBC Driver 17 的 /opt/microsoft/msodbcsql17/lib64/ 中和 ODBC Driver 13 的 /opt/microsoft/msodbcsql/lib64/ 中。This file is installed in /opt/microsoft/msodbcsql17/lib64/ for the Driver 17 and in /opt/microsoft/msodbcsql/lib64/ for Driver 13. |
msodbcsqlr17.rll 或 msodbcsqlr13.rll msodbcsqlr17.rll or msodbcsqlr13.rll | 驱动程序库的附带资源文件。The accompanying resource file for the driver library.此文件安装在 [driver .so directory]./share/resources/en_US/ 中This file is installed in [driver .so directory]./share/resources/en_US/ |
msodbcsql.hmsodbcsql.h | 头文件,它包含使用驱动程序所需的所有新定义。The header file that contains all of the new definitions needed to use the driver. 注意: 你无法在同一个程序中引用 msodbcsql.h 和 odbcss.h。Note: You cannot reference msodbcsql.h and odbcss.h in the same program. msodbcsql.h 安装在 ODBC Driver 17 的 /opt/microsoft/msodbcsql17/include/ 中和 ODBC Driver 13 的 /opt/microsoft/msodbcsql/include/ 中。msodbcsql.h is installed in /opt/microsoft/msodbcsql17/include/ for Driver 17 and in /opt/microsoft/msodbcsql/include/ for Driver 13. |
LICENSE.txtLICENSE.txt | 包含最终用户许可协议条款的文本文件。The text file that contains the terms of the End-User License Agreement.此文件位于 ODBC Driver 17 的 /usr/share/doc/msodbcsql17/ 中和 ODBC Driver 13 的 /usr/share/doc/msodbcsql/ 中。This file is placed in /usr/share/doc/msodbcsql17/ for Driver 17 and in /usr/share/doc/msodbcsql/ for Driver 13. |
RELEASE_NOTESRELEASE_NOTES | 包含发行说明的文本文件。The text file that contains release notes.此文件位于 ODBC Driver 17 的 /usr/share/doc/msodbcsql17/ 中和 ODBC Driver 13 的 /usr/share/doc/msodbcsql/ 中。This file is placed in /usr/share/doc/msodbcsql17/ for Driver 17 and in /usr/share/doc/msodbcsql/ for Driver 13. |
msodbcsqlr17.rll
或 msodbcsqlr13.rll
,具体取决于驱动程序版本。This file is called msodbcsqlr17.rll
or msodbcsqlr13.rll
depending on the driver version..rll
文件的位置与驱动程序本身的位置(so
或 dylib
)相对,如上表中所述。The location of the .rll
file is relative to the location of the driver itself (so
or dylib
), as noted in the table above.自版本 17.1 开始,如果从相对路径加载失败,驱动程序还将尝试从默认目录加载 .rll
。As of version 17.1 the driver will also attempt to load the .rll
from the default directory if loading from the relative path fails.Linux 上的默认资源文件路径是 /opt/microsoft/msodbcsql17/share/resources/en_US/
。The default resource file path on Linux is /opt/microsoft/msodbcsql17/share/resources/en_US/
.