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;
query.sql
?