I am facing a weird situation. When I am trying to connect to MySql database using a "mysql" connection, it works.
mysql connection string -> mysql_connect($HOST, $USER, $PASSWORD, $DB);
But the connection fails immediately fails when I use either "mysqli" or "PDO"
mysqli connection string -> mysqli_connect($HOST, $USER, $PASSWORD, $DB);
PDO Connection string -> new PDO("mysql:host=$HOST;dbname=$DB", $USER, $PASSWORD);
The specific error that it throws is,
SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'localhost' (10061
Can you guys help me out? Thanks.