💡 build.gradle에 dependency 추가
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'mysql:mysql-connector-java'
runtimeOnly 'com.mysql:mysql-connector-j'
💡 application.properties 형식
server.port = 80
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/shop?serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=12345678
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.type.descriptor.sql=trace
spring.jpa.hibernate.ddl-auto=create
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
💡 application.yml 형식
server:
port: 80
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/shop?serverTimezone=UTC
username: root
password: 12345678
jpa:
properties:
hibernate:
show_sql: true
format_sql: true
org:
hibernate:
type:
descriptor:
sql: trace
hibernate:
ddl-auto: create
database-platform: org.hibernate.dialect.MySQL8Dialect