Categories
flyway java mysql spring spring-boot

Table ‘flyway_schema_history’ was not locked with LOCK TABLES

I’m trying to use flyway as a migration tool for my existing database using:

Flyway V5.2.4 & Mysql V8.0.16

but when migrating gives me this error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException: 
Error while retrieving the list of applied migrations from Schema History table `allexpress`.`flyway_schema_history`
------------------------------------------------------------------------------
SQL State : HY000
Error Code : 1100
Message : Table 'flyway_schema_history' was not locked with LOCK TABLES
Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
Error while retrieving the list of applied migrations from Schema History table `allexpress`.`flyway_schema_history`
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
Error while retrieving the list of applied migrations from Schema History table `allexpress`.`flyway_schema_history`