BACKEND/Spring

스프링, mysql 연동 gradle, applicaion.yml 설정하기

송이 🫧 2022. 2. 8. 00:46

build.gradle

dependencies에 추가

dependencies {
..
runtimeOnly 'mysql:mysql-connector-java'
..
}

application.yml 

datasource:
  url: jdbc:mysql://{localhost or IP}:{포트번호}/{DB명}?serverTimezone=Asia/Seoul
  username: 사용자명
  password: 비밀번호
  driver-class-name: com.mysql.cj.jdbc.Driver