2017-05-27 45 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