[英]CodeIgniter mysqli real_connect(): MySQL server has gone away
I am playing around with CodeIgniter 3 Dev and I keep getting this issue with MySQL. 我正在使用CodeIgniter 3 Dev,并且MySQL一直在出现此问题。
mysqli::real_connect(): MySQL server has gone away
Anyone else playing with CI 3 and happened to run into this and found a fix? 还有其他玩CI 3的人碰巧遇到了这个问题并找到了解决方法吗?
My work is local using wamp with a remote connection into a mysql server. 我的工作是在本地使用wamp并通过远程连接到mysql服务器。 I tried changing
php.ini
我尝试更改
php.ini
mysqli.reconnect = Off
to 至
mysqli.reconnect = On
but it still pops up after an hour or two. 但一两个小时后仍会弹出。
在core/My_Model.php
使用它:
$this->db->reconnect();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.