List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:April 29 2011 9:54pm
Subject:RE: ERROR 2006 (HY000)
View as plain text  
>-----Original Message-----
>From: Larry Martell [mailto:larry.martell@stripped]
>Sent: Friday, April 29, 2011 5:31 PM
>To: Jerry Schwartz
>Cc: mysql mailing list
>Subject: Re: ERROR 2006 (HY000)
>
>On Fri, Apr 29, 2011 at 3:23 PM, Jerry Schwartz <jerry@stripped> wrote:
>> I'm getting
>>
>> ERROR 2006 (HY000) at line 10: MySQL server has gone away
>>
>> while trying to do an insert through the MySQL CLI. Our database is so 
>> small
>> that I haven't gotten around to doing any tuning, so this came out of the
>> blue. I'm not quite sure where to start.
>>
>> Here's what things look like at my end:
>>
>> =====
>>
>> select version();
>> +------------------+
>> | version()        |
>> +------------------+
>> | 5.1.36-community |
>> +------------------+
>>
>>
>> DROP TEMPORARY TABLE IF EXISTS new_titles;
>>
>> CREATE TEMPORARY TABLE new_titles (
>>        new_title VARCHAR(255), INDEX (new_title),
>>        new_title_like VARCHAR(255), INDEX (new_title_like)
>>        ) ENGINE MYISAM;
>>
>> INSERT INTO new_titles
>> VALUES
>>
>> ('(I.Z) Queenco Ltd. (QNCO) - Financial and Strategic SWOT Analysis 
>> Review',
>> '(I%Z) Queenco Ltd%(QNCO)%Financial%Strategic SWOT Analysis Review'),
>> ('@Comm Corporation (ATCM) - Strategic SWOT Analysis Review', '@Comm
>> Corporation (ATCM)%Strategic SWOT Analysis Review'),
>> ('010017 Telecom GmbH - Strategic SWOT Analysis Review', '010017 Telecom
>> GmbH%Strategic SWOT Analysis Review'),
>> ('1 & 1 Internet AG - Strategic SWOT Analysis Review', '1%1 Internet
>> AG%Strategic SWOT Analysis Review'),
>> ('1,618 STRICT AB (STRI B) - Financial and Strategic SWOT Analysis Review',
>> '1%618 STRICT AB (STRI B)%Financial%Strategic SWOT Analysis Review'),
>> ('1199SEIU Benefit and Pension Funds - Strategic SWOT Analysis Review',
>> '1199SEIU Benefit%Pension Funds%Strategic SWOT Analysis Review'),
>> ('1300 Smiles Limited (ONT) - Financial and Strategic SWOT Analysis 
>> Review',
>> '1300 Smiles Limited (ONT)%Financial%Strategic SWOT Analysis Review'),
>> ('141 Capital Inc. - Strategic SWOT Analysis Review', '141 Capital
>> Inc%Strategic SWOT Analysis Review'),
>> ('1855 SA (AL185) - Financial and Strategic SWOT Analysis Review', '1855 SA
>> (AL185)%Financial%Strategic SWOT Analysis Review'),
>> ('1pm plc (OPM) - Financial and Strategic SWOT Analysis Review', '1pm plc
>> (OPM)%Financial%Strategic SWOT Analysis Review'),
>> ('1st Century Bancshares, Inc. (FCTY) - Financial and Strategic SWOT 
>> Analysis
>> Review', '1st Century Bancshares%Inc%(FCTY)%Financial%Strategic SWOT 
>> Analysis
>> Review'),
>> ('1st NRG Corp. (FNRC) - Financial and Strategic SWOT Analysis Review', 
>> '1st
>> NRG Corp%(FNRC)%Financial%Strategic SWOT Analysis Review'),
>> ('1st RED AG (SXL) - Financial and Strategic SWOT Analysis Review', '1st 
>> RED
>> AG (SXL)%Financial%Strategic SWOT Analysis Review'),
>> ('20 Microns Limited (533022) - Financial and Strategic SWOT Analysis
>Review',
>> '20 Microns Limited (533022)%Financial%Strategic SWOT Analysis Review'),
>> ('21 Holdings Limited (1003) - Financial and Strategic SWOT Analysis 
>> Review',
>> '21 Holdings Limited (1003)%Financial%Strategic SWOT Analysis Review'),
>> ('21LADY Co., Ltd. (3346) - Financial and Strategic SWOT Analysis Review',
>> '21LADY Co%Ltd%(3346)%Financial%Strategic SWOT Analysis Review'),
>>
>> ==================
>>
>> ... and so on for about 15000 rows.
>>
>> Before I go through changing this to 15000 separate inserts, I'd like to 
>> know
>> how to "fix" the problem the right way. I looked at all of the system
>> variables, and none of them seemed to apply. I probably missed something
>> obvious.
>
>This is most likely due to your query exceeding the max packet size.
>Break it up into smaller pieces or increase max_allowed_packet.
[JS] You hit the nail on the head.

I wondered about max_allowed_packet, but the documentation says that it 
applies to BLOBs or long strings. It didn't occur to me that a query could, 
itself, be a long string.

My query is a tad more than 2mb, so setting max_allowed_packet to 3mb fixed it 
right up.

Thanks!

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site: www.the-infoshop.com







Thread
ERROR 2006 (HY000)Jerry Schwartz29 Apr
  • Re: ERROR 2006 (HY000)Larry Martell29 Apr
    • RE: ERROR 2006 (HY000)Jerry Schwartz29 Apr