SQL 服务器 2014 连接字符串在 php 中无效 [87]
SQL Server 2014 Connection string is not valid [87] in php
我从 SQL SERVER 2008 从 SQL SERVER 2014 升级。
我已经在 PHP 上使用 SQL SERVER 2008。从 SQL SERVER 2008 升级到 SQL SERVER 2014 后,它似乎无法正常工作。它显示以下错误:
[Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network
Interfaces: Connection string is not valid [87]
[Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
[Microsoft][ODBC Driver 11 for SQL Server]A network-related or
instance-specific error has occurred while establishing a connection
to SQL Server. Server is not found or not accessible. Check if
instance name is correct and if SQL Server is configured to allow
remote connections. For more information see SQL Server Books Online.
更改 $server 中的 \
并首先提供 UID 和 PWD,然后提供数据库
$server = "servername\instancename";
$connectionInfo = array( "UID"=>"", "PWD"=>"****", "Database"=>"", );
$conn = sqlsrv_connect( $server, $connectionInfo );
if ($conn === false)
die("<pre>".print_r(sqlsrv_errors(), true));
echo "Successfully connected!";
这会起作用..
我从 SQL SERVER 2008 从 SQL SERVER 2014 升级。
我已经在 PHP 上使用 SQL SERVER 2008。从 SQL SERVER 2008 升级到 SQL SERVER 2014 后,它似乎无法正常工作。它显示以下错误:
[Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]
[Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
[Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
更改 $server 中的 \
并首先提供 UID 和 PWD,然后提供数据库
$server = "servername\instancename";
$connectionInfo = array( "UID"=>"", "PWD"=>"****", "Database"=>"", );
$conn = sqlsrv_connect( $server, $connectionInfo );
if ($conn === false)
die("<pre>".print_r(sqlsrv_errors(), true));
echo "Successfully connected!";
这会起作用..