Smiley Happy Coder

Lyle Barras

Lyle is Smiley Happy Coder

Developing for the web since 1999, that's 16 years

Fixing the PDO Exception in your first laravel migration under MAMP

I admit, this one has caught me a couple of times so I thought I’d write a very quick post about it.

Each time I install Laravel on MAMP I get a PDO Exception issue and I wonder why.

PDO Exception

The issue arrises when MySQL tries to connect. MAMP prefers connecting via a socket so the easy fix is to add this line to database.php

'unix_socket'   => '/Applications/MAMP/tmp/mysql/mysql.sock',

That’s all folks, worlds shortest blog post.

  • Top