我尝试使用以下代码从托管Amazon RDS MS-SQL
库中打开与MSSQL
的连接:
<?php
$dbhost = "xxxxxxx.rds.amazonaws.com";
$dbport = 1433;
$dbname = "xxxxx";
$dbuser = "xxxxxx";
$dbpass = "xxxxxxx";
try {
$dbh = new PDO ("dblib:host=$dbhost:$dbport;dbname=$dbname","$dbuser","$dbpass");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
我收到此错误:
Failed to get DB handle: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)