?
Solved

MYSQL ERROR 1160 error writing communication packets

Posted on 2014-11-01
7
Medium Priority
?
2,330 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 2000 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

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
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

801 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