0

I just grabbed the latest version of MAMP Pro (3.1) and installed it only to find that it removes MySQL PDO entirely. That's a problem since the framework I'm using requires PDO to connect to the database. I tried grabbing the extensions from the old version of MAMP, but it immediately throws errors.

How do I get MySQL PDO back for MAMP 3.1? I've looked on the site and can't find a downloads page to roll back to the older version.

agentphoenix
  • 67
  • 2
  • 7
  • mamp should have its own copy of pdo, you might just have to enable/install it. and no, grabbing copies of the libs from older versions is pointless. "My fancy aluminum baseball bat is broken, so I grabbed this stone age wooden club. they're both bats, why isn't it working?" – Marc B Mar 25 '15 at 21:56
  • No, it only includes the Postgres PDO extension. No MySQL PDO extension at all. – agentphoenix Mar 25 '15 at 21:57

1 Answers1

1

In MAMP 3.1, they've made the switch to mysqlnd which actually includes mysql, mysqli, and PDO. The problem is that they've removed all the PDO settings in php.ini because they aren't using the MySQL PDO extension. Because of this change, from the command line, PHP is looking at the wrong MySQL socket file. To fix this, I updated the php.ini file with the following line:

pdo_mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock

After that, everything started working again.

If anyone from Appsolute sees this, PLEASE re-add the PDO settings to the INI files so this sort of thing doesn't happen!

agentphoenix
  • 67
  • 2
  • 7
  • Strange because my Mamp Pro 3.1 php.ini file has this line by default... `[PDO] pdo_mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock` And my PDO is working fine. I just bought it yesterday so i did no update or whatever. – Peter Mar 26 '15 at 10:32
  • We have just updated to 3.1 from 3.0.5 and we are getting PDO errors. Our `php.ini` already has the `pdo_mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock` line set by default. Not found a solution yet, had to revert back to 3.0.5 – Mark Beech Mar 26 '15 at 11:09
  • @Peter Mine didn't actually have that line, which is what was causing the issue since it was looking at the wrong .sock file. I only figured that out because I ran a `php -i | grep pdo` and saw the wrong file referenced in the output. Not sure why mine had issues and yours didn't though. Strange. – agentphoenix Mar 26 '15 at 21:52
  • indeed strange! It isn't answered but i think this is in a way related to this problem here http://stackoverflow.com/questions/27792878/why-doesnt-php-see-mamps-mysql-pdo-driver. Could be something that happens while you install MAMP? Maybe it happened in your situation and not in mine? – Peter Mar 27 '15 at 12:38
  • FYI you need to use "php -i|grep php.ini" to find the php.ini file it's using. – Damien McKenna Mar 29 '15 at 11:08