jacketList

Spring Boot DB 오류(Failed to determine a suitable driver class) 본문

Spring

Spring Boot DB 오류(Failed to determine a suitable driver class)

ukkkk7 2023. 10. 11. 09:16
728x90
반응형
***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

 

application.properties에 아래와 같이 추가

 

spring.datasource.url=jdbc:mysql://localhost:3306/스키마명?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=유저아이디
spring.datasource.password=패스워드
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

"스키마명" 자리에는 사용하려는 MySQL 데이터베이스 스키마(schema)의 이름을 넣기

예를 들어, 스키마명을 "myapp" 또는 "ecommerce"와 같이 애플리케이션 또는 프로젝트의 이름에 기반하여 정의

728x90
반응형