1

I am using ubuntu 12.04. I have a .sql file that is around 5 megabytes.

When I use the command: mysql -u -p -v database query.sql The server prints out the content of the file (because of --verbose) and then stops at the bottom. It never exits.

When I do ctrl+c I get an error:

ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

I am updating a column in a table with different values, which has over 150,000 rows.

My max_allowed_packet variable in the my.cnf is set to 64M

When I check if the update worked only some of the values are updated, not all.

Why am I getting this error?

EDIT: Sample code for query.sql:

UPDATE srs_person_to_org 
 SET org_id = CASE 
WHEN p_uuid = '1000001' THEN '2' 
WHEN p_uuid = '1000002' THEN '2' 
WHEN p_uuid = '1000003' THEN '2' 
WHEN p_uuid = '1000004' THEN '2' 
          .......
WHEN p_uuid = '1152337' THEN '19' 
WHEN p_uuid = '1152338' THEN '19' 
WHEN p_uuid = '1152339' THEN '19' 
ELSE org_id 
END; 
  • Can you post some of the code from query.sql ? – RolandoMySQLDBA Aug 1 '14 at 21:00
  • Maybe increase this dev.mysql.com/doc/refman/5.0/en/… – Mihai Aug 1 '14 at 22:55
  • I posted the code for query.sql, as you can see it updates over 150,000 rows with different values @RolandoMySQLDBA – masterhon Aug 2 '14 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.