I have the same problem as this when I want to index a very large table on one of its non-unique columns which is an integer, and I tried all the solutions that are proposed in that post that has at least one vote up. I still couldn't fix it. Any other ideas?
I have enough memory:
max_allowed_packet: 2G, innodb_buffer_pool_size: 9G
All the time out settings mentioned in this post and here are set to much higher numbers than the default.
While this is not necessary an answer for loosing connection in mysql workbench it is a workaround. When it comes to long running queries in mysql workbench, even if one changes the mysql workbench parameters, there seems to be a connection time_out issue still occuring. So, run the query from mysql command line and see if it works. If it works when you run from the mysql command line and not from workbench, you know its just a mysql workbench issue and not some other issue.