General |  Social Media |  Miscellaneous
Login | Register
srcraft blog logo
  • Business
  • News
  • Shopping
  • Travel
  • Disease
  • Pets
  • Life
  • Health
  • Technology
  • Category
  • Contact Us
Latest Blog : 
☛ Who can be called a true monk ? ☛ God arranges everything ☛ Faith in god ☛ What is a Rotary Encoder? How does it work? ☛ Things to Know About PLC and SCADA ☛ According to Ramayana, why do women wear jewelry? ☛ After registering an FIR, can I not apply for a government job ☛ Daughter: A angel of his father ☛ How VOIP Phone System is Useful For your Business? ☛ test 
Home > Innovation & Technology > Codeigniter

#2013 - Lost connection to MySQL server during query


#2013 - Lost connection to MySQL server during query

Usually that happens when you use JOIN for combining multiple table in database. If your mysql query takes more time, then server could give you negative response like

#2013 - Lost connection to MySQL server during query

Or

MySQL server has gone away

SELECT RELEASE_LOCK('b131086dbc463d8c717e59bd41af9cdd914ce035') AS ci_session_lock

May be you have below type of query

SELECT * FROM `table1` JOIN `table2` ON `table1`.`product_id` = `table2`.`sku` JOIN `table3` ON `table1`.`user_id` = `table3`.`cust_id` WHERE `date` BETWEEN "2018-07-01" AND "2018-07-31" GROUP BY `table1`.`order_id` ORDER BY `table1`.`date` DESC, `table1`.`order_id` DESC

And your above query is showing below result

 Showing rows 0 - 24 (67 total, Query took 18.9670 seconds.) [o_aaded_time: 2018-07-30 23:14:38... - 2018-07-24 01:52:02...] [o_order_id: 180730054438... - 180723082202...]

This will Killed queries for the database.

For solving this problem, you have to take below steps.

First of all, your query should be executed within 15 seconds. Currently above query is getting 18.9670 seconds. So you have to optimize your query and you have to reduce execution time below 15 seconds.

Another way for solving this issue is "Add below line into your my.cnf or my.ini in the [mysqld] section

max_allowed_packet=32M

Written By: Charles Miller Published in Codeigniter


Search

Publish your passions on srcraftblog.com

Latest Post

☛ Who can be called a true monk ?

☛ God arranges everything

☛ Faith in god

☛ What is a Rotary Encoder? How does it work?

☛ Things to Know About PLC and SCADA

☛ According to Ramayana, why do women wear jewelry?

☛ After registering an FIR, can I not apply for a government job

☛ Daughter: A angel of his father

☛ 'Gurukul' literally means 'family of Guru' or 'clan of Guru'

☛ When does mother's honor get less


We are accepting well-written informative Guest Posts on srcraftblog.com

Innovation & Technology

Artificial Intelligent blogs
Cryptocurrency blogs
Digital India blogs
Data science blogs
Neuroscience blogs
Programming blogs

Physical science

Physics blogs
Chemistry blogs
Earth science blogs
Geology blogs
Oceanography blogs
Meteorology blogs

Industry

Business blogs
Economy blogs
Freelancing blogs
Leadership blogs
Productivity blogs
Work blogs

Society

Basic income blogs
Education blogs
Environment blogs
Media blogs
Philosophy blogs
Women blogs
About us |  Write for us |  Terms and conditions |  Contact us

© 2021 SRCRAFT INIDA