So I am using my cmd on my laravel folder and I tried to do (php artisan migrate:install). 2 errors came up.
[PDOException] SQLSTATE[HY000] [2006] MySQL server has gone away
[ErrorException] PDO::__construct(): MySQL server has gone away
Can anyone please explain what I did wrong?
You have Lost SQL connection to server during query. It is temporally issue. This is because of very low default setting of max_allowed_packet
.
Raising max_allowed_packet
in my.cnf
(under [mysqld]) to 8 or 16M usually fixes it.
[mysqld]
max_allowed_packet=16M
NOTE: This can be set on your server as it's running. You need to restart
the MySQL service once you are done.
Use: set global max_allowed_packet=104857600
. My value sets it to 100MB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With