Reputation: 1011
I am trying to insert data 50,000 rows with one query therefore Server is going away. I have tried to change max_allowed_packet but its not changing. Any advice.
Thanks in advance
Upvotes: 3
Views: 1911
Reputation: 1011
I have set max_allowed_packet=64 in my.ini and restarted server. Now its working fine. Thanks to all for help.
Upvotes: 1
Reputation: 7961
There look for wait_timeout and some mysql_ping and a few more suggestions.
Upvotes: 1
Reputation: 27906
It's probably either taking so long to build the query that the server disconnects due to idle timeout, or it's taking so long to transmit that it thinks there's been an error. The best method is probably to break your insert into groups of 25-100 records.
Upvotes: 1
Reputation: 11488
Have you checked mysqls's wait_timeout time? Also, what are you using to import the records (a script, a sql editor, the command line)? Php forexample uses it's own connect_timeout set in php.ini that will cause the error you're seeing.
Upvotes: 1