I have been running into this issue every time I try and sync a medium size JSON object to my database so we can perform some reporting on it. From looking into what can cause i
While mysqldump is the commonly reported cause for this it is not the only one.
In my case running artisan:migrate on any database will also trigger this error for different databases on the same server.
http://bugs.mysql.com/bug.php?id=42041 Mentions table locks/flush which would be called in a mysqldump so worth checking if you have any migrations, locks or flushes happening simultaneously.
Failing that try switching the prepares to emulated.
'options' => [
\PDO::ATTR_EMULATE_PREPARES => true
]
This error occurs when mysqldump is in progress. It doesn't matter which DB dump is in progress. Wait for the dump to finish and this error will vanish.
The issue is with the table definition being dumped which cause this error.
Yeah I tried changing these mysql settings, but it still occurs sometime (mostly when running heavy mysql backups/dumps at night)..
table_open_cache 128=>16384
table_definition_cache 1024=>16384