이전에 MYSQL이 3306 port를 사용하고 있어서
Maria DB는 3307로 설정했다
STS에서도 문제없이 프로젝트 생성하고 RUN하니
2024-02-15 14:04:48.206[0;39m [31mERROR[0;39m [35m16944[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mcohttp://m.zaxxer.hikari.pool.HikariPool [0;39m [2m:[0;39m HikariPool-1 - Exception during pool initialization.
java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=localhost)(port=3306)(type=master) : (conn=45) Access denied for user 'cos'@'localhost' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:66) ~[mariadb-java-client-2.7.2.jar:na]
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:192) ~[mariadb-java-client-2.7.2.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1392) ~[mariadb-java-client-2.7.2.jar:na]
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635) ~[mariadb-java-client-2.7.2.jar:na]
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150) ~[mariadb-java-client-2.7.2.jar:na]
at org.mariadb.jdbc.Driver.connect(Driver.java:89) ~[mariadb-java-client-2.7.2.jar:na]
at cohttp://m.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-3.4.5.jar:na]
at cohttp://m.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-3.4.5.jar:na]
이런 알 수 없는 오류가 발생했다
자세히 읽어보니
Could not connect to address=(host=localhost)(port=3306)
나는 분명 3307을 쓸려했는데 3306을 찾아서 port가 겹쳤던 것이다
aplication.yml 이나 aplication.properties에서 관리 하는데
나는 aplication.yml에서 관리했다
yml에서
datasource:
driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:3306/photogram?
datasource:
driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:3307/photogram?
이렇게 변경하니 문제없이 돌아갔다
출처 :
https://mj-youn.github.io/spring-boot-properties-%EC%84%A4%EC%A0%95
'Error > SpringBoot' 카테고리의 다른 글
HttpClient.executeOpen (0) | 2024.07.02 |
---|---|
@AutoWired vs @RequiredArgsConstructor (0) | 2024.03.09 |