Solved

MYSQL ERROR 1160 error writing communication packets

Posted on 2014-11-01
7
1,893 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Creating and Managing Databases with phpMyAdmin in cPanel.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
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 …

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now