게시판 Spring Mysql DB 문제

도규원·2022년 2월 6일
0

spring boot

목록 보기
2/16

오랜기간 속을 썩였던 문제가 있다. JPA를 이용해 내부 H2로 구동했을 때는 발생하진 않았지만 AWS RDS MysqlDB 혹은 MariaDB쪽으로 연결을 했을 때 발생한 오류이다.
Intelij 내부의 TestConnection으로는 연결이 되었다.

주요 문장은
1. Failed to initialize JPA EntityManagerFactory: Unable to create requested service
2. Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource2.
3. Error creating bean with name 'entityManagerFactory' defined in class path resource
4. Error creating bean with name 'org.springframework.boot.autoconfigure.session.JdbcSessionConfiguration$SpringBootJdbcHttpSessionConfiguration': Unsatisfied dependency expressed through method 'setTransactionManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource
많지만 결국은 JPA 문제인것 같다.

시도한 방법
dialect 추가
여전히 에러가 뜨지만 오류메세지가 바뀌었다.
No database selected. 데이터베이스가 선택되지 않은 것 같다.
show databases;
use mysql;
을 입력해주었다.

그러고 실행하자
Access denied for user 'admin'@'%' to database 'mysql'
admin 계정에 권한이 없다고 한다.

mysql 콘솔에 들어가니
Access denied for user 'admin'@'localhost' (using password: YES)
비밀번호가 틀렸을 때 나오는 메세지가 뜬다.
재설정 조치법도 아예 그 권한이 없어서 불가능했다.

mariadb를 삭제한 후 다시 실행해보았다.

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

소켓 에러가 발생했다.

profile
Engineer

0개의 댓글