![]() |
CI Session - Lost connection to MySQL server during query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: CI Session - Lost connection to MySQL server during query (/showthread.php?tid=72434) |
CI Session - Lost connection to MySQL server during query - bharatmaher - 12-19-2018 My site is working fine but sometimes it suddenly starts giving CI_SESSION error... Error is : Code: ERROR -> Query error: Lost connection to MySQL server during query - Invalid query: SELECT `data` Please let me know if anyone has any idea about this... My config setting is : Code: $config['sess_cookie_name'] = 'ci_session'; RE: CI Session - Lost connection to MySQL server during query - php_rocs - 12-19-2018 @bharatmaher, In your config database settings file, what do you have ['pconnect'] set to? RE: CI Session - Lost connection to MySQL server during query - Pertti - 12-20-2018 Some time ago we noticed issues with sessions as well when using database storage. This has been discussed few times on this forum why it has to work the way it does, but we ended up changing to file based session storage while we were moving to Redis. Had no session issues since, but last 18 months we never managed to move to Redis due to reason completely unrelated to CodeIgniter :| RE: CI Session - Lost connection to MySQL server during query - skunkbad - 12-20-2018 This isn't a CodeIgniter issue. Same errors can be seen in your logs with any framework. This is a problem with the server. I know this because I usually modify the error handler so it emails me when there are errors, and I get these errors from multiple accounts/websites, at the same time, and they are not all using CodeIgniter. Unless you are in control of the server, or your host can provide more information, it's unlikely there's anything you can do about it. RE: CI Session - Lost connection to MySQL server during query - bharatmaher - 12-26-2018 (12-19-2018, 09:18 AM)php_rocs Wrote: @bharatmaher, @php_rocs, Thanks for your update!. My ['pconnect'] is set to FALSE. Thank you. RE: CI Session - Lost connection to MySQL server during query - bharatmaher - 12-26-2018 (12-20-2018, 08:08 AM)skunkbad Wrote: This isn't a CodeIgniter issue. Same errors can be seen in your logs with any framework. This is a problem with the server. I know this because I usually modify the error handler so it emails me when there are errors, and I get these errors from multiple accounts/websites, at the same time, and they are not all using CodeIgniter. Unless you are in control of the server, or your host can provide more information, it's unlikely there's anything you can do about it. @skunkbad, Thank you for your response. I'll definitely discuss with my server administrator. The error is frustrating for us because it completely makes my site down for 4-5 minute and we ended up with losing some important websites customers. RE: CI Session - Lost connection to MySQL server during query - InsiteFX - 12-27-2018 You can also try this. PHP Code: $this->db->reconnect(); RE: CI Session - Lost connection to MySQL server during query - bharatmaher - 01-02-2019 (12-27-2018, 03:59 AM)InsiteFX Wrote: You can also try this. @InsiteFX, Where I can add above line? RE: CI Session - Lost connection to MySQL server during query - InsiteFX - 01-19-2019 I would run it when you do your queries or in your model constructor. |