亚马逊RDS PHP MSSQL

时间:2017-06-06 10:23:17

标签: php amazon-web-services rds dlib

我尝试使用以下代码从托管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)

0 个答案:

没有答案