2017-05-27 104 views
1

我SQL数据库连接到PHP网站(两者都是在Azure上),在PHP在SQL数据库眼看锁 - 天青

一切似乎都很正常,并且连接字符串也是完美的。
当我尝试连接到数据库时,它连接并执行所有操作,但是当我尝试连接到另一个数据库时,它显示以下错误。

Array (
    [0] => Array (
    [0] => 08001 
    [SQLSTATE] => 08001 
    [1] => 5 
    [code] => 5 
    [2] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [5]. 
    [message] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [5]. 
) 
    [1] => Array (
    [0] => HYT00 
    [SQLSTATE] => HYT00 
    [1] => 0 
    [code] => 0 
    [2] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired 
    [message] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired 
) 
    [2] => Array (
    [0] => 08001 
    [SQLSTATE] => 08001 
    [1] => 5 
    [code] => 5 
    [2] => [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. 
    [message] => [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. 
    ) 
) 

而且还 我看到这是没有得到连接数据库这个锁定迹象。

lock image

这种锁没有出现在数据库,成功连接上。
而且所有三个(两个数据库和一个Web应用程序)都在相同的资源组

我连接使用存储在网站上的应用程序设置连接字符串两个数据库。

回答

2

实际上,这是TDE(透明数据加密)图标而不是标志。见Transparent Data Encryption with Azure SQL Database

而且根据上面的错误消息,最可能的原因是您正在使用的服务器名称不正确。这里有一些建议,供您解决此问题:

  1. 连接字符串恰好等于在Azure的门户服务器名称确保主机名。

enter image description here

  • 使用PHP以测试连接是否可以建立或没有的代码示例。不要忘记用自己的密码替换。
  • enter image description here