IT 발자취.../스프링
[IssueCase] java.sql.SQLException: Access denied for user ‘ID’@’xxx.xxx’ (using password: YES
gintire
2018. 12. 9. 03:26
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를 입력하시면됩니다.
spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/testDB
spring.datasource.username=user
spring.datasource.password=password