Skip to content

Commit

Permalink
chore : H2 -> Mysql로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DOEKYONG committed Apr 18, 2023
1 parent 7cf708c commit 288d313
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
implementation group: 'com.h2database', name: 'h2', version: '2.0.206'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'mysql:mysql-connector-java:8.0.32'
// implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

}

tasks.named('test') {
useJUnitPlatform()
}
}
34 changes: 23 additions & 11 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@ server.servlet.encoding.force-response=true
spring.mustache.suffix=.html
spring.mustache.servlet.cache=false
spring.mvc.hiddenmethod.filter.enabled=true

spring.datasource.driverClassName=org.h2.Driver
#spring.datasource.url=jdbc:h2:~/spring-qna-db;
#spring.datasource.url=jdbc:h2:mem:test ???? ??
spring.datasource.url=jdbc:h2:~/be-java-cafe/spring-qna-db
spring.datasource.username=sa
spring.datasource.password=

spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.web-allow-others=true
server.port= 8080
#spring.datasource.driverClassName=org.h2.Driver
##spring.datasource.url=jdbc:h2:~/spring-qna-db;
##spring.datasource.url=jdbc:h2:mem:test ???? ??
#spring.datasource.url=jdbc:h2:~/be-java-cafe/spring-qna-db
#spring.datasource.username=sa
#spring.datasource.password=
#
#spring.h2.console.enabled=true
#spring.h2.console.path=/h2-console
#spring.h2.console.settings.web-allow-others=true
spring.mustache.servlet.expose-session-attributes=true
server.servlet.session.tracking-modes=cookie

# MySQL ??
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# DB Source URL
spring.datasource.url=jdbc:mysql://localhost:3306/BOARD?serverTimezone=UTC&characterEncoding=UTF-8

# DB username
spring.datasource.username= root

# DB password
spring.datasource.password= 1234

0 comments on commit 288d313

Please sign in to comment.