您现在的位置是:This extension requires the Microsoft ODBC Driver for SQL Server

This extension requires the Microsoft ODBC Driver for SQL Server

分类: MSSQL 日期:2020-06-09点击:3155

直接用命令行测试,正常连接

/usr/local/freetds/bin/tsql -H 192.169.100.101 -p 1433 -U jishu8 -P jishu8


但是在代码测试,CentOS下PHP7连接mssql报错

SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver for SQL Server for x64: https://go.microsoft.com/fwlink/?LinkId=163712


下载地址:https://docs.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver15


尝试运行


[root@localhost ~e]#curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo
[root@localhost ~]# yum install -y msodbcsql mssql-tools unixODBC-devel


安装明细如下:


Total download size: 5.3 M
Downloading Packages:
(1/5): msodbcsql-13.1.9.2-1.x86_64.rpm                                                           | 4.1 MB     00:01
(2/5): msodbcsql17-17.5.2.1-1.x86_64.rpm                                                         | 802 kB     00:00
(3/5): mssql-tools-17.5.2.1-1.x86_64.rpm                                                         | 223 kB     00:00
(4/5): unixODBC-2.3.7-1.rh.x86_64.rpm                                                            | 213 kB     00:00
(5/5): unixODBC-devel-2.3.7-1.rh.x86_64.rpm                                                      |  42 kB     00:00



This extension requires the Microsoft ODBC Driver for SQL Server报错解决,现在提示: [unixODBC][Driver Manager]Data source name not found, and no default driver specified



标签: PHP Linux MSSQL

站长简介

    姓名:喻理
    微信:yuli0927
    邮箱:yuli0927@126.com
    不懂业务的运维工程师不是一个好程序员。

分类

最新文章

热门文章

全站标签