Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 11004
- 온프레미스
- 프로젝트 생성
- SaaS
- algorithm
- valueof
- 최대공배수
- 백준
- 웹 서버
- java
- IaaS
- 데이터타입
- 프로그래머스
- 유클리드 호제법
- aws
- parseInt
- 짝수
- 알고리즘
- Python
- level1
- INT
- 2진수
- 11652
- PaaS
- 자료형
- 리스트
- 최대공약수
- 홀수
- 문자열 숫자 변환
- IntelliJ
Archives
- Today
- Total
Ga0Lee
[Spring Boot] mysql 데이터베이스 연결하기 본문
1. dependency 추가
- springboot 버전이 2.x.x 인 경우는
runtimeOnly 'mysql:mysql-connector-java'
- 3.x.x 이상부터는
runtimeOnly 'com.mysql:mysql-connector-j'
2. 데이터베이스 생성
나는 Command Line Client를 통해서 미리 데이터 베이스와 유저 생성했다.
3. application.properties에 데이터베이스 정보 입력
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/데이터베이스?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&serverTimezone=Asia/Seoul
spring.datasource.username=유저네임
spring.datasource.password=비밀번호
'Spring Boot' 카테고리의 다른 글
[Spring Boot] AWS S3 연결 SDK 에러 (0) | 2023.08.07 |
---|---|
[Spring Boot] AWS S3 버킷 연결 에러 (0) | 2023.08.07 |
[Spring Boot] HttpMediaTypeNotAcceptableException 에러 해결 (0) | 2023.07.31 |
[Spring Boot] MySQL Access denied for user (0) | 2023.07.06 |
[Spring Boot] Could not find com.mysql:mysql-connector-j 오류 (0) | 2023.05.29 |