본문 바로가기
study/db

mysql jpa connect

by stilinski 2022. 10. 1.
728x90

 

 

dependency

    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'mysql:mysql-connector-java'

 

 

application.properties

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/board?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&serverTimezone=Asia/Seoul 
spring.datasource.username=boardAdmin
spring.datasource.password=a12345678!
spring.jpa.hibernate.ddl-auto=create
hibernate.dialect=org.hibernate.dialect.MySQL8Dialect

#sql문 보이게
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.show-sql=true

board는 db이름

728x90

'study > db' 카테고리의 다른 글

oracle sql 새로운접속 생성, 권한 , 시퀀스 생성  (0) 2022.06.16

댓글