Solved

MYSQL ERROR 1160 error writing communication packets

Posted on 2014-11-01
7
2,120 Views
Last Modified: 2014-11-03
Dear experts,

I just received an error from MySQL with error 1160 'error writing communication packets'.
I have a stored procedure that does this:
step 1: compares the data from two tables and insert into a tmp table.
step 2: Results from tmp table will then copied over to a table with FEDERATED engine. This Federated table is connected to another table on a different server.

I wish to know if there is anything wrong with step 1 or 2 from above that may cause this error?  The error does not always pop up. Once in a while it will  pop up but is random. I also wish to know if this error will cause major data integrity issue or errors in my data. Thanks
0
Comment
Question by:Kinderly Wade
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:Insoftservice
ID: 40417581
Please provide stored procedure code if possible

http://www.experts-exchange.com/OS/Linux/Distributions/Q_27092356.html
0
 

Author Comment

by:Kinderly Wade
ID: 40417866
My code is like this:

FIRST PART of the QUERY:
INSERT INTO tmp_tbl
SELECT i.item, i.price, i.qty, i.disc, i.sku, i.loc
FROM (SELECT id, item, price, qty, disc, sku, loc
            FROM inventory) i
LEFT JOIN List l ON i.id = l.id
WHERE l.id IS NULL;
//above will take care of any new items been added to the product line

SECOND PART of QUERY:

TRUNCATE online.online_list;
//online_list is a FEDERATED table which is similar to the online_list data table from the online server.
//this will truncate all data from online_list table

INSERT INTO online.online_list
SELECT * FROM tmp_tbl
//this simply copies any new item added to the product line from tmp_tbl and insert those items into online_list data table.
0
 
LVL 15

Accepted Solution

by:
Insoftservice earned 500 total points
ID: 40417886
Issue may happen even if FEDERATED tables are not actually replicated (FEDERATED turned ON, but database which contains FEDERATED tables excluded using any of the repliate* or binlog* do/ignore options).

Did you checked the link provided its majorly timeout issue

I would try increasing (temporarily) your net_read_timeout, net_write_timeout, and max_allowed_packet variables. When reloading a mysqldump file dies, it's generally caused by one of those.

Inserting too many data can even give you the error

Try to set the max_allowed_packet to 256M, you can add it to /etc/my.cnf or my.ini


[mysqld]
max_allowed_packet=256M

SET GLOBAL max_allowed_packet = 1024 * 1024 * 256;
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:Kinderly Wade
ID: 40417920
Hi insoftservice,

I've noticed that if update didn't trigger for a long period of time and when it updates, the error comes out. If there is a consistant update then the error will not always pop up. It will ususally pop up on the initial attempt when the data hasn't been updated for a while.

I think mostly the timeout issue is causing the problem. I will try to set the pack size and see if I can increase the time out settings.

Thanks. Yes I did take a look at the link.
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 40418240
Was there any success after doing it
0
 

Author Comment

by:Kinderly Wade
ID: 40418515
I am trying to reconfigure the time_out of federated table (if there is any). Although errors popped out but it doesn't affect the result of my updates. Update is successful although the error pops out. If the system consistently updating then that error will not show up.

Is there a way to disable the error? I am not sure if I extend the timeout will be a good idea because the time out setting maybe there for a good reason.

let me know what you think. Thanks.
0
 

Author Closing Comment

by:Kinderly Wade
ID: 40420958
Hi insofotservice,

When I bring my code to my work place and test it out, it works without error. Suppose maybe the business connection is different from a home connection.

I will try to figure it out. For now no errors has popping up when I used the business connection.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL querys that gives me from one table into another. 2 41
MySQL recovery 7 33
Syntax issue with my Where Clause SQL 2012 20 38
SQL Syntax 6 32
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question