我写了一个简单的脚本来查询MSSQL-Express 2012 Server中的一些数据。 所有工作都适用于第一个实例:
$host = "192.168.13.3\test1";
$user = "sa";
$passwd = "test1";
self::$instance = new PDO ("dblib:host=$host","$user","$passwd");
但如果我尝试连接到我的第二个实例,如:
$host = "192.168.13.3\test2";
$user = "sa";
$passwd = "test2";
self::$instance = new PDO ("dblib:host=$host","$user","$passwd");
我收到此错误:
[message:protected] => SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)
[string:Exception:private] =>
[code:protected] => 20009
使用MSSQL-Server-Management-Tool,我可以毫无问题地访问这两个实例。 有人暗示我能找到我的失败吗?
提前致谢