HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Lost connection to server executing ALTER TABLE

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
executinglostserveraltertableconnection

Problem

I'm trying to execute an ALTER TABLE statement in MySQL 5.6. Every time I run the query, it's creating a file with a name like #sql2-503-918bf.ibd taking full table size. I don't have enough disk space to run the query, because whenever I try to run it, another #sql… file will be created.

Query:

ALTER TABLE kt_ticket_message 
    ADD COLUMN from_email varchar(255) NOT NULL COMMENT 'From email';



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

Table size is 5 GB, database size is 6 GB.

These are parameters in the config file:

wait_timeout=30
interactive_timeout=60
max_allowed_packet=1M


Can I increase the timeout parameters?

Solution

Change specific timeouts value to 6000 it's available in all new versions of MySQL Workbench.


Open Edit → Preferences → SQL Editor → DBMS connection read time out
(in seconds): 600


Changed the value to 6000.

Also unchecked limit rows as putting a limit in every time I want to search the whole data set gets tiresome.

Context

StackExchange Database Administrators Q#220421, answer score: 3

Revisions (0)

No revisions yet.