I\'m using flyway 1.5 and mysql Ver 14.14 Distrib 5.1.52, for unknown-linux-gnu (x86_64) using readline 5.1
I wrote the following migration:
We just ran into this issue and managed to find a solution that worked for us. It seems that Flyway uses at least two connections: one to lock the schema_version
table, and one to actually run the alters. This issue occurs when the alters take long enough to cause the connection locking the schema_version
table to timeout. The easiest way to fix this is the bump up the MySQL wait_timeout
to something relatively large. In our case we set it to 480 minutes (or 28800 seconds):
set global wait_timeout=28800;