본문 바로가기
  • 오늘도 한걸음. 수고많았어요.^^
  • 조금씩 꾸준히 오래 가자.ㅎ
IT기술/spring

[IssueCase] java.sql.SQLException: Access denied for user ‘ID’@’xxx.xxx’ (using password: YES

by 미노드 2021. 8. 31.

Spring Framework에서
MySQL connection을 할 때 생길 수 있는
오류입니다.

오류의 원인은 현재 IP로의
접근이 제한된것 인데요.

해결법은 MySQL에서 권한을 설정해주면 됩니다.

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'xxx.xxx.xxx.xxx' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

생성하고자하는 USERNAME과
권한을 주고자하는 IP주소
그리고 PASSWORD를 입력하시면됩니다.

application.properties

spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/testDB spring.datasource.username=user spring.datasource.password=password

 

 

https://gintrie.tistory.com/14