I have a connection file done up with PDO. When I try to connect to my live database, I get an error:
SQLSTATE[HY000] [2002] Connection refused.
I did everything I could think of to try to get this to work. But I keep getting:
SQLSTATE[HY000] [2002] Connection refused.
I am trying to connect to a live database with phpMyAdmin. Here's my code...
<?php
$servername = "10.xxx.x.85:3306";
$username = "nephilim42_341";
$password = "rxxxxxxxxxx3";
try {
$dbh = new PDO("mysql:host=$servername;dbname=wdv341", $username, $password);
/*** echo a message saying we have connected ***/
echo 'Connected to database';
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>