CodeIgniter Forums
[split] [split] Log errors - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: [split] [split] Log errors (/showthread.php?tid=66100)



[split] [split] Log errors - magikboo23 - 09-05-2016

Hi sorry if i am offtopic how to avoid the following log errors ?:

[2016-09-05 15:50:02][E/codeigniter][URI=/] Severity: Warning --> mysqli::query(): MySQL server has gone away /web/htdocs/www/home/system/database/drivers/mysqli/mysqli_driver.php 306
[2016-09-05 15:50:02][E/codeigniter][URI=/] Severity: Warning --> mysqli::query(): Error reading result set's header /web/htdocs/www/home/system/database/drivers/mysqli/mysqli_driver.php 306
[2016-09-05 15:50:02][E/codeigniter][URI=/] Query error: MySQL server has gone away - Invalid query: SELECT GET_LOCK('3084335f0fbc7d242719711b7970a602ef6fa509', 300) AS ci_session_lock
[2016-09-05 15:50:02][E/codeigniter][URI=/] Severity: Error --> Call to a member function row() on boolean /web/htdocs/www/home/system/libraries/Session/drivers/Session_database_driver.php 358

i dont know if depends by last ci version but pls can u suggest anything in order to fix it?


RE: [split] [split] Log errors - InsiteFX - 09-05-2016

Check your MySQL my.in or my.cnf file to see if there is a wait_timeout

It should be = to 28800 for 8 hours

Code:
set wait_timeout = 28800;

Also with CI you can do the following:

Code:
$this->db->reconnect();

If your doing a lot of database work I would autoload the database in ./application/config/autoload.php