java.sql.SQLException: Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.解决方案

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 fiel…

	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

(0)
上一篇 2023-04-16
下一篇 2023-04-16

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注