diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Database.java b/hibernate-core/src/main/java/org/hibernate/dialect/Database.java index ca4bfef6e4..3402ffacc1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Database.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Database.java @@ -358,6 +358,14 @@ public enum Database { return new MySQL57Dialect(); } } + else if ( majorVersion < 8) { + // There is no MySQL 6 or 7. + // Adding this just in case. + return new MySQL57Dialect(); + } + else if ( majorVersion == 8 ) { + return new MySQL8Dialect(); + } return latestDialectInstance( this ); }