Illegal mix of collations

数据库库表编码格式引起的冲突;

Caused by: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Solution:更改表的编码

ALTER TABLE 表名称 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

Reffered:http://blog.csdn.net/love_legain/article/details/79004485

Stacktrace

### Error updating database.  Cause: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
### The error may involve com.stylefeng.guns.common.persistence.dao.SearchParamMapper.timesIncremental-Inline
### The error occurred while setting parameters
### SQL: UPDATE guns.`search_param` SET times = (1 + times) WHERE parameter = ?
### Cause: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1267]; Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='; nested exception is java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
    ...............

你可能感兴趣的:(Illegal mix of collations)