Connection time out in flyway

后端 未结 2 1816
遇见更好的自我
遇见更好的自我 2021-01-22 20:04

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:



        
2条回答
  •  既然无缘
    2021-01-22 20:48

    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;
    

提交回复
热议问题