PHP Artisan Migrate with MAMP and Unix Socket

后端 未结 5 2083
礼貌的吻别
礼貌的吻别 2021-02-01 10:27

I was developing my application originally in Laravel 4.2 but have since decided to move it to the 5.0 version so that it covers a lot more changes and strengths that 5.0 has ov

5条回答
  •  广开言路
    2021-02-01 11:06

    I created a StackOverflow account solely to answer this question, and maybe help prevent someone going through the pain that I went through.

    Answers that I found online ranged from changing 127.0.0.1 to localhost, changing the port from 3306 to 33060 and vice-versa, and making sure the unix_socket was correct.

    The solution that solved my problem was changing:

    DB_CONNECTION=mysql
    DB_HOST=localhost
    

    to

    DB_CONNECTION=mysql
    DB_HOST=mysql
    

    I hope this helps someone out there. It took me 4 hours to find this painfully obvious solution...and it was found 1min29s into an obscure YouTube video with under 1000 views.

提交回复
热议问题