Search code examples
hibernatespring-bootspring-data-jpaflyway

Flyway Warns: SQL State: HY000 - Error Code: 1366


Flyway in spring boot is working though while running first version of database which is rather large and contains many insert statements apart from database schema logs the following in console

2017-11-01 17:04:16.096  INFO 1268 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'flyway' of type [class org.flywaydb.core.Flyway] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-11-01 17:04:16.105  INFO 1268 --- [  restartedMain] o.f.core.internal.util.VersionPrinter    : Flyway 3.2.1 by Boxfuse
2017-11-01 17:04:16.367  INFO 1268 --- [  restartedMain] o.f.c.i.dbsupport.DbSupportFactory       : Database: jdbc:mysql://localhost/coop_erp (MySQL 5.5)
2017-11-01 17:04:16.397  INFO 1268 --- [  restartedMain] o.f.core.internal.command.DbValidate     : Validated 2 migrations (execution time 00:00.014s)
2017-11-01 17:04:16.463  INFO 1268 --- [  restartedMain] o.f.c.i.metadatatable.MetaDataTableImpl  : Creating Metadata table: `coop_erp`.`schema_version`
2017-11-01 17:04:19.678  INFO 1268 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Current version of schema `coop_erp`: << Empty Schema >>
2017-11-01 17:04:19.679  INFO 1268 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Migrating schema `coop_erp` to version 1.1 - Init
2017-11-01 17:05:03.707  WARN 1268 --- [  restartedMain] o.f.c.internal.dbsupport.JdbcTemplate    : DB: Incorrect string value: '\xA0Produ...' for column 'description' at row 5 (SQL State: HY000 - Error Code: 1366)
2017-11-01 17:05:03.708  WARN 1268 --- [  restartedMain] o.f.c.internal.dbsupport.JdbcTemplate    : DB: Incorrect string value: '\xA0Inven...' for column 'friendly_name' at row 78 (SQL State: HY000 - Error Code: 1366)

Problem

How can i eliminate the warn: SQL State: HY000 - Error Code: 1366.

Does it mean the data which caused error was not inserted.

Note: Database schema and data has been extracted from MySQL Workbench.


Solution

  • I managed to find solution myself. For some reason flyway doesn't like double spaces within words.Removing double spaces made the database migration go smoothly. A breeze.