Solved

MYSQL ERROR 1160 error writing communication packets

Posted on 2014-11-01
7
1,986 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
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL Query to include null values 3 29
SQL Server 2012 r2 - Sum totals 2 25
Query Help - MSSQL - Averages 5 27
Present Absent from working date rage 11 21
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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