CI Session - Lost connection to MySQL server during query |
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';
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 :|
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.
(12-19-2018, 09:18 AM)php_rocs Wrote: @bharatmaher, @php_rocs, Thanks for your update!. My ['pconnect'] is set to FALSE. Thank you.
(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.
You can also try this.
PHP Code: $this->db->reconnect(); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I would run it when you do your queries or in your model constructor.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |