大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说java.sql.SQLException: Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.解决方案,希望您对编程的造诣更进一步.
描述: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
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/6134.html