I have seen the other SO questions dealing with the bug in php 5.3 and have php_pdo_mysql enable in the php.ini file located in MAMP/conf/php5.4.4. When I look at the phpInfo, under PDO it only has the sqlite driver enabled. If anyone has any suggestions on how to troubleshoot this further it would be greatly appreciated.
This is the line in question:
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
I'm including some additional info as I think it applies to the solutions I've tried so far
try
{
$db = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password, $options);
}
catch(PDOException $ex)
{
die("Failed to connect to the database: " . $ex->getMessage());
}
I tried replacing all the variable parameters of the PDO object with string values ie. {$host} becomes 'localhost' etc. and got the error message in the catch block with $ex->getMessage() being 'could not find driver'
i had to do is : Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' with pdo
=> issues have been resolved
Check out this DSN:
Instead of MySQL attr init command.