I am trying to migrate from MySQLi to PDO (PHP 5.5.20, MySQL v5.0.11, Fedora 19) to no avail:PDO simply refuses to make a connection, and I have checked everywhere for an answer. My code is as simple this:
ini_set('display_errors', 1);
error_reporting(E_ALL);
$hostname_localhost ="127.0.0.1";
$database_localhost ="ilinfra_administration";
$username_localhost ="ilinfra_euldlm58";
$password_localhost ="nhmtqvuhdldlea1999";
$userID = 106;
$rel1LegID = "V13310604";
$dsn = 'mysql:dbname=ilinfra_administration;host=localhost;port=3306';
try{
$dbh = new PDO($dsn,$username_localhost,$password_localhost);
}
catch(PDOException $e)
{
echo $e->getMessage();
}
exit();
The flow goes past the try block, no IDE screaming, no errors displayed, no PDO object created. localhost and 127.0.0.1 fail. Adding or removing a database port both fail. The wrong password will throw an exception (no user access), not the database name or the username. That's where everything starts to complain. I will appreciate your help an awful lot.