We ran into this error “PHP Warning: Error while sending QUERY packet. PID=25016” the other day when trying to run an update query on a database with approximately 3.8 million records in it. New data had become available for 2.1 million of these records.
These were submitted using a php program which fetched and parsed enormous CSV files before using a PDO statement to insert or update the records into MySQL. Upon running the program, the PHP warning would appear.