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).
종료 코드 1(으)로 완료된 프로세스
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/board
spring.datasource.username=root
spring.datasource.password=qwer5124*
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.format_sql=true
// MySQL
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
// DB Source URL. board는 스키마의 이름이다.
spring.datasource.url=jdbc:mysql://localhost:3306/board
// DB username, password
spring.datasource.username=root
spring.datasource.password=123456
// 처리시 발생하는 SQL을 보여줄 것인지 결정
spring.jpa.show-sql=true
// 프로젝트 실생시 자동으로 DDL(create, alter, drop)을 생성할 지 결정하는 설정
// create : 매번 테이블 생성 새로 시도,
// update : 변경 필요한 경우 alter로 변경, 테이블이 없는 경우 create
spring.jpa.hibernate.ddl-auto=update
// 실제 JPA 구현체인 Hibernate가 동작하면서 발생하는 SQL을 포맷팅해서 출력 -> 실행되는 SQL 가독성 높임
spring.jpa.properties.hibernate.format_sql=true