php远程连接sql server失败SQLSTATE] => 08001

我在本地测试远程连接服务器A的sqlserver没问题,但是我在服务器B上远程连接服务器A的sqlserver,出现此错误,跪求解决办法。Array([0]=>Array... 我在本地测试远程连接服务器A的sql server没问题,但是我在服务器B上远程连接服务器A的sql server,出现此错误,跪求解决办法。
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 1231
[code] => 1231
[2] => [Microsoft][SQL Server Native Client 10.0]Named
Pipes Provider: Could not open a connection to SQL Server [1231].
[message] => [Microsoft][SQL Server Native Client
10.0]Named Pipes Provider: Could not open a connection to SQL Server
[1231].
)

[1] => Array
(
[0] => HYT00
[SQLSTATE] => HYT00
[1] => 0
[code] => 0
[2] => [Microsoft][SQL Server Native Client 10.0]Login
timeout expired
[message] => [Microsoft][SQL Server Native Client
10.0]Login timeout expired
)

[2] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => 1231
[code] => 1231
[2] => [Microsoft][SQL Server Native Client 10.0]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.
[message] => [Microsoft][SQL Server Native Client 10.0]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.
)

)
展开
 我来答
百度网友d1a1135
2015-01-05 · TA获得超过143个赞
知道小有建树答主
回答量:315
采纳率:50%
帮助的人:183万
展开全部
GRANT ALL PRIVILEGES ON 数据库.* TO 'root'@'localhost' IDENTIFIED BY '密码' with grant option;
GRANT ALL PRIVILEGES ON 数据库.* TO 'root'@'%' IDENTIFIED BY '密码'with grant option;
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式