My laravel project is getting error every morning, and after some time it becomes okay. I don't understand what is the issue.
I googled it and see some similar issues. But it does not resolve my issue.
db version is 5.1.1
My laravel project is getting error every morning, and after some time it becomes okay. I don't understand what is the issue.
I googled it and see some similar issues. But it does not resolve my issue.
db version is 5.1.1
Enable the ATTR_EMULATE_PREPARES of PDO (disabled by default at Laravel) for resolve the problem. Just insert the option config:
'options' => [
\PDO::ATTR_EMULATE_PREPARES => true
]
For example
'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
]
],