Error while sending STMT_PREPARE packet

Error while sending STMT_PREPARE packet

Posted By: pmietlicki

Published to Laravel on Jan 25, 2016

This is a bug under laravel and it is linked to the connection to the database.
I had a lot of error messages just after using memcached so I guess it could be linked to it.

You have to change "causedByLostConnection" function inside Connection.php (framework/src/Illuminate/Database) by adding 'Error while sending STMT_PREPARE packet' :

protected function causedByLostConnection(Exception $e)
$message = $e->getMessage();
return Str::contains($message, [
'server has gone away',
'no connection to the server',
'Lost connection',
'is dead or not enabled',
'Error while sending STMT_PREPARE packet'

Sources :

Tags: database, laravel, stmt