General error: 1615 Prepared statement needs to be re-prepared

前端 未结 2 949
暗喜
暗喜 2021-02-19 07:14

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

2条回答
  •  执念已碎
    2021-02-19 07:56

    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
            ]
    

提交回复
热议问题