본문 바로가기
오류해결

[오류해결]org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.MySQL5InnoDBDialect] as strategy [org.hibernate.dialect.Dialect]

by devthrive 2023. 12. 21.
SMALL

프로젝트 만드는 중에 Mysql8.0.33 버전을 사용중에 평소와 다른 오류가 생겼다.

 

org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.MySQL5InnoDBDialect] as strategy [org.hibernate.dialect.Dialect]

 

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/board
    username: root
    password: 1234

  jpa:
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
    open-in-view: false
    show-sql: true
    hibernate:
      ddl-auto: create-drop

여기서 오류가 난것인데 

 * database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

부분 때문에 오류가 발생한다. 

Hibernate 6부터는 버전검색 안해도 되도록 통일 시킨거 같다.

https://docs.jboss.org/hibernate/orm/6.0/migration-guide/migration-guide.html#_dialects

 

6.0 Migration Guide

As back-ground, Hibernate does understand whether a fetch is actually, truly circular. It simply understands that while walking a fetch-graph it encounters the same table/column(s) making up a particular foreign-key. In this case, it simply stops walking t

docs.jboss.org

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/board
    username: root
    password: 1234

  jpa:
    database-platform: org.hibernate.dialect.MySQLDialect
    open-in-view: false
    show-sql: true
    hibernate:
      ddl-auto: create-drop

 * database-platform: org.hibernate.dialect.MySQLDialect

이렇게 변경하면 된다. 

LIST