【发布时间】:2017-06-08 19:06:39
【问题描述】:
与 MsSQL 的连接失败。 错误信息:
SQLSTATE: HYT00
Code: 0
Message: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired
SQLSTATE: 08001
Code: 10057
Message: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: Error code 0x2749
SQLSTATE: 08001
Code: 10057
Message: [unixODBC][Microsoft][ODBC Driver 13 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.
操作系统:Ubuntu 16.04
我根据guide安装了所有需要的驱动程序。
try {
$conn = new PDO ("sqlsrv:Server=host.com\instance; Database = DBName",NULL,NULL);
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
} catch( PDOException $e ){
die(print_r( $e->getMessage()));
}
由于我使用 Windows NT 身份验证,我将用户名和密码留空。
真的需要帮助!!!!
谢谢!!
【问题讨论】:
-
您在使用 Kerberos 吗?请确认您的客户端是 Ubuntu 还是您的服务器。
-
我的网络服务器是 Ubuntu。 Web 托管在远程 Ubuntu 虚拟机上。然后我现在正试图从我的本地机器访问该网站。加载网站时,后端需要与另一个远程数据库服务器通信。我与网站的连接很好,但是从网站后端到数据库的连接失败了。
标签: php sql-server apache ubuntu authentication