Total Pageviews

Monday, March 11, 2013

laravel trying to connect via unix:///var/mysql/mysql.sock

I got that when using artisan migrate on my MAMP PRO :
when using :


php artisan migrate:install

 No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) 


After digging around, the solution seems to be create a symlink from /var/mysql/mysql.sock to /Applications/MAMP/tmp/mysql/mysql.sock. 

 sudo mkdir /var/mysql sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock 



That fixed the problem for me. Hope this is useful to anyone else!