1

I am playing around with CodeIgniter 3 Dev and I keep getting this issue with 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?

My work is local using wamp with a remote connection into a mysql server. I tried changing php.ini

mysqli.reconnect = Off 

to

mysqli.reconnect = On 

but it still pops up after an hour or two.

Peter K.
  • 8,028
  • 4
  • 48
  • 73
sim
  • 197
  • 1
  • 4
  • 9
  • possible duplicate of [Sudden "MySQL server has gone away" error in PHP site](http://stackoverflow.com/questions/1884111/sudden-mysql-server-has-gone-away-error-in-php-site) –  Aug 31 '15 at 13:47

1 Answers1

1

Use this in core/My_Model.php:

$this->db->reconnect();
Undo
  • 25,519
  • 37
  • 106
  • 129