ThinkPHP5 设置数据库长连接

PHP ThinkPHP MySQL About 267 words

设置

application目录下的database.php文件中将parma字段修改为:

// 数据库连接参数
'params' => [
    \PDO::ATTR_PERSISTENT   => true,
    \PDO::ATTR_CASE         => \PDO::CASE_LOWER,
],

数据库连接,断线再连

// 开启断线重连
'break_reconnect' => true,

同时需要检查MySQLwait_timeoutinteractive_timeout

Views: 4,843 · Posted: 2019-04-08

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh