Laravel SQLSTATE [HY000]:常规错误:1615准备好的语句需要重新准备

I recently launched my Laravel based site, and I had no problems, but 40 mins ago when I checked it I get this error:

SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: select * from `users` where `id` = 1 and `remember_token` = mfjLlbv3fR49TYGAqmUgBSqVVAKmoHhq26ws8rojuXxee5qWcvHrcdoTXs6W limit 1) 

Why is this happening? Everything was okay and now suddenly I cannot do anything.

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.

Cheers,

Suren

Hello i got the same error, after few refreshes is gone. Maybe the mysqldump is the source of the problem.

When i logged the mysqldump was not running, but maybe it was finished, because when i refreshed there was no error

It seems to work adding

'options'   => [
                \PDO::ATTR_EMULATE_PREPARES => true
            ]

Inside projectName/config/database.php file in DB configuration. It will be like this:

'mysql' => [
    'driver'    => 'mysql',
    'host'      => env('DB_HOST', 'localhost'),
    'database'  => env('DB_DATABASE', 'forge'),
    'username'  => env('DB_USERNAME', 'forge'),
    'password'  => env('DB_PASSWORD', ''),
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
    'strict'    => false,
    'options'   => [
        \PDO::ATTR_EMULATE_PREPARES => true
    ]
],

Laravel 5.1. Hope it will help!