현재 SpringSecurity, Mysql로 작업 중
SpringSecurity의 로그인 기능을 사용하던 중 아래와 같은 내용의 에러가 발생했다.
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select username,series,token,last_used from persistent_logins where series = ?]; nested exception is java.sql.SQLSyntaxErrorException: Table 'familyevents.persistent_logins' doesn't exist
SQL 문법 에러인데 이유는 persistent_logins 라는 테이블이 존재하지 않기 때문이라고 한다.
remember-me 기능을 사용하다가 발생한 에러 같기도 하다.

https://docs.spring.io/spring-security/site/docs/3.0.x/reference/remember-me.html
10. Remember-Me Authentication
Remember-me authentication is not used with basic authentication, given it is often not used with HttpSessions. Remember-me is used with UsernamePasswordAuthenticationFilter, and is implemented via hooks in the AbstractAuthenticationProcessingFilter superc
docs.spring.io

그래서 아래 글을 참조하여 테이블을 생성해 주었다.
https://mkyong.com/spring-security/spring-security-remember-me-example/
Spring Security Remember Me Example - Mkyong.com
- Spring Security Remember Me Example
mkyong.com
CREATE TABLE persistent_logins (
username varchar(64) not null,
series varchar(64) not null,
token varchar(64) not null,
last_used timestamp not null,
PRIMARY KEY (series)
);
에러 해결!
'프로젝트 정리 > 경조사 가계부 프로젝트' 카테고리의 다른 글
9. 회원가입 토큰 인증 (0) | 2022.05.28 |
---|---|
8. 회원가입 이메일 토큰 누락 에러 해결 (0) | 2022.05.25 |
#6 회원가입 로직 구현시 에러 해결 (0) | 2022.05.09 |
#4 회원가입 기능 구현하기 (구상) (0) | 2022.01.28 |
#3 경조사 가계부 프로젝트 시작 (0) | 2022.01.28 |