mysql create unique index if not exists code example
Example: mysql create index lost connection
Go to Edit -> Preferences -> SQL Editor
set to a higher value this parameter:
DBMS connection read time out (in seconds). For instance: 86400.
Close and reopen MySQL Workbench.
Kill your previously query that probably is running and run the query again.