gpt4 book ai didi

php - 本地.错误: PDOException: SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared in happen in every morning

转载 作者:行者123 更新时间:2023-11-29 10:30:07 27 4
gpt4 key购买 nike

我的laravel项目每天早上都会出错,一段时间后就没事了。我不明白这是什么问题。

我用谷歌搜索了一下,发现了一些类似的问题。但这并不能解决我的问题。

db version is 5.1.1

最佳答案

启用 PDO 的 ATTR_EMULATE_PREPARES(Laravel 默认禁用)来解决问题。只需插入选项配置即可:

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

例如

  '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
]
],

关于php - 本地.错误: PDOException: SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared in happen in every morning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47566315/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com