CodeIgniter Forums

Full Version: [split] [split] Log errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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