SpringSecurity使用MySQL数据库进行认证,MySQL中带中文的用户认证报此错误
org.springframework.security.authentication.InternalAuthenticationServiceException: Index: 0, Size: 0
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
MySQL的url未配置中文即转换
url: jdbc:mysql://localhost:3306/usertest?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8
在url后面添加
&useUnicode=true&characterEncoding=utf-8
即可