Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RobertBaelde's avatar

Php artisan migrate throws [2006] MySQL server has gone away

Hi,

Recently when i try to run php artisan migrate on any laravel 5 project running on my homestead server, it throws an error saying '[2006] MySQL server has gone away'. When i run a migrate command on a laravel 4 project it works fine.

I'm really confused, because a few days ago it just worked fine.

Anyone had the same problem and has an solution for this?

0 likes
2 replies
frezno's avatar

i'm not working with Homestead, so just a shot out of the hip:
did you set up all info in the .env file correctly (and changed the name from env.example to .env) ?

RobertBaelde's avatar

Ofcourse, and when running eloquent from the site it works just fine. The migrate command used to run without any error's until a few days ago..

Please or to participate in this conversation.