JetBrains/IntelliJ
[IntelliJ] JPA 설정 (MySQL 연결)
개발자 윤정
2021. 7. 17. 18:27
※ 해당 포스터는 Gradle Project를 기준으로 합니다.
01. build.gradle 추가
build.gradle에 아래 dependency를 추가한 후 build 합니다.
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'mysql:mysql-connector-java'
02. application.properties 설정
application.properties에 database 연결과 관련하여 설정합니다.
# db source url
spring.datasource.url=jdbc:mysql://localhost:포트번호/스키마?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
# db response name
spring.datasource.username=디비계정
# db response password
spring.datasource.password=비밀번호