Ususally the error is raised either if a packet is too large or if the connection times out. If you issue “large” INSERT or UPDATE statements (e.g. BLOB, TEXT columns), then you should consider setting max_allowed_packet variable to a larger value. Otherwise connect_timeout, wait_timeout parameters should be tuned in my.ini or my.cnf. Of course, MySql server may be faulty (crashes), but that case is unlikely.