application.properties를 application.yml 로 변경해주고
내용은 이런식으로 작성합니다
mysql의 경우
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: db서버주소
username: db계정
password: db비번
jpa:
show-sql: true
properties:
hibernate:
format_sql: true
data.rest:
base-path: /api
detection-strategy: annotated
server:
port: 포트번호
postgres의 경우
spring:
datasource:
url: jdbc:postgresql://<호스트>:<포트>/<데이터베이스명>
username: <사용자명>
password: <비밀번호>
driver-class-name: org.postgresql.Driver
jpa:
show-sql: true
properties:
hibernate:
format_sql: true
data.rest:
base-path: /api
detection-strategy: annotated
server:
port: 9797
반응형
'웹 개발 > 🍃 SpringBoot' 카테고리의 다른 글
SpringBoot | CRUD 구현 - 아이디중복검사(Read),Ajax (0) | 2023.05.19 |
---|---|
SpringBoot | HTML, CSS, JS 변경 시 실시간 반영 방법 (0) | 2023.05.19 |
SpringBoot | CRUD 준비,Header<T>,service,apicontroller (0) | 2023.04.30 |
SpringBoot | model(repository) with JPA Repository (0) | 2023.04.19 |
SpringBoot | model(entity) with JPA Auditing (0) | 2023.04.19 |