java.sql.SQLException: Could not connect: Access denied for user 'root'@'localhost' (using password: YES) Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
데이터베이스를 오라클에서 MySQL로 바꿔 테이블 생성했는데 계정 권한 주는걸 깜박했다.
. 계정 권한을 추가해줘야한다.
💗 해결
- 사용자를 추가하며 비밀번호까지 설정한다.
CREATE USER 계정명입력@localhost identified by '비밀번호';
- 계정에 권한 부여
GRANT ALL PRIVILEGES ON 데베명입력.* TO 계정명입력@localhost;
- 권한 적용
flush privileges;
- 권한 확인
'개인 공부😊 > Spring' 카테고리의 다른 글
[Spring] REST란? (0) | 2022.11.24 |
---|---|
[Spring] The prefix "context" for element "context:component-scan" is notbound. (0) | 2022.11.19 |
[Spring] SQL Error [1046] [3D000]: No database selected (0) | 2022.11.19 |