错误详情信息:html
### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xE8\x8E\xB7\xE5\x8F\x96...' for column 'result' at row 1 ### The error may involve com.blog.springboot.dao.ApiLogDao.insert-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO wp_api_log ( class_name, method_name, params, `result`, consume_time, update_date ) VALUES ( ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Incorrect string value: '\xE8\x8E\xB7\xE5\x8F\x96...' for column 'result' at row 1 ; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE8\x8E\xB7\xE5\x8F\x96...' for column 'result' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE8\x8E\xB7\xE5\x8F\x96...' for column 'result' at row 1] with root cause java.sql.SQLException: Incorrect string value: '\xE8\x8E\xB7\xE5\x8F\x96...' for column 'result' at row 1
错误缘由分析:
插入的数据列中,若是是中文的话,则会出现上面的错误,若是是英文的话,就不会出现错误。
故推测与字段列编码有关系,果真查看表对应的字符编码发现都是latin,最后将其改成utf8便可解决。java
若是想永久解决这样的问题,可参考该连接:http://www.javashuo.com/article/p-zxgfzfvu-gk.html
上面的问题我好久以前就遇到过,因此那个时候就已经记录了解决的办法。spring