티스토리 뷰

 

mysql 연결하다가 맞닥뜨린 에러다.

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'entityManagerFactory' defined in class path resource
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: 
Failed to initialize dependency 'dataSourceScriptDatabaseInitializer' of
LoadTimeWeaverAware bean 'entityManagerFactory': Error creating bean with name
'dataSourceScriptDatabaseInitializer' defined in class path resource
[org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: 
Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' 
parameter 0: Error creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: 
Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource'
threw exception with message: Cannot load driver class: org.mysql.cj.jdbc.Driver

에러메세지를 읽어보면

마지막 줄에 Cannot load driver class:org.mysql.cj.jdbc.Driver 라고 쓰여있다.

 

 

 

 

build.gradle에

runtileOnly 'com.mysql:mysql-connector-j' 

작성

 

 

application.properties에

spring.data.source.driver-class-name=com.mysql.cj.jdbc.Driver 

작성 

 

org.mysql.cj.jdbc.Driver 가 아니었던 것

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/11   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
글 보관함