PHP PDO:SQLSTATE [HY000] [2002]无法建立连接,因为目标计算机主动拒绝它。

I'm looking for a solution of my issue with PHP and PDO..

try {
    $db = new PDO("mysql:dbname=PHP;host=localhost", "User", "Password");
    // set the PDO error mode to exception

} catch(PDOException $e) {
    echo 'Fehler: ' . htmlspecialchars($e->getMessage());
    exit();
}

I don't know how to fix it... any ideas? I tried to change the port to 3306 like here:

$db = new PDO("mysql:dbname=PHP;port=3306;host=localhost", "User", "Password");

but it didn't change anything.

Thanks