6. IntelliJ에서 MySQL로 세팅

Choonsik S·2025년 2월 4일
post-thumbnail

영상에서 강사님은 MariaDB를 선택하셨지만 나는 MySQL과 연결했다.

build.gradle 에서

의존성 **MySQL Driver** 추가

runtimeOnly 'com.mysql:mysql-connector-j'

application.properties 에서

spring.application.name=qna_service


spring.datasource.url=jdbc:mysql://localhost:3306/qna_service
spring.datasource.username=SQL아이디이름
spring.datasource.password=SQL비밀번호
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.thymeleaf.check-template-location=false

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

# 정적 리소스 위치를 지정
spring.web.resources.static-locations=classpath:/static/

logging.level.org.springframework.web=DEBUG
logging.level.org.springframework.web.servlet=TRACE```
profile
One step, Two step

0개의 댓글