MySQL으로 DB 교체하기
- build.gradle에 MySQL에 대한 의존성 추가
implementation 'mysql:mysql-connector-java:8.0.32'
- application.yml 설정 파일 수정
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/{DB이름}?useSSL=false&serverTimeZone=Asia/Seoul&characterEncoding=utf-8
username: {사용자}
password: {비밀번호}
비밀번호는 대문자, 소문자, 숫자, 특수문자가 포함된 8자 이상으로 설정해야 한다.
비밀번호 재설정 없이 스프링 서버를 실행했다가 오류를 마주했다.
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
비밀번호 재설정은 아래와 같이 진행하면 된다. (cmd 창에서 진행함)
alter user '{사용자}'@'{호스트}' identified by '{새비밀번호}';
commit;
'Back-end > Spring' 카테고리의 다른 글
ResponseEntity 클래스 (0) | 2023.10.17 |
---|---|
어노테이션, HandlerMethodArgumentResolver, DTO (1) | 2023.10.10 |
JPA, Hibernate 에러 -> org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : (0) | 2023.09.25 |
Maven 이란? (0) | 2023.07.31 |
어노테이션(Annotation) 정리 (0) | 2023.04.20 |