描述:java项目连mysql时报错“java.sql.SQLException: Unknown character set index for field ‘255‘ received from server”
原因:这是编码不匹配的原因,MySQL驱动和数据库字符集设置不搭配,默认字符集已从latin1变成utf8mb4,因而系统变量受到影响
解决:直接在连接的URL后加上
useUnicode=true&characterEncoding=utf8
就可以了。
或者直接升级jar包!!
java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.解决方案
原文地址:https://www.cnblogs.com/xuyupengblogs/p/12951538.html