im trying to access cPanel database from my computer, i already added my ip address to Remote MySQL Access Host but it keeps throwing error
Connection failed: SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
and this i my code :
try {
$conn = new PDO("mysql:host=$servername;dbname=myDB;port=3306", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}