Unknown initial character set index ‘255’ received from server.
Initial client character set can be forced via the ‘characterEncoding’
property.
字符集的问题,这种情况一般要检查 程序编码 、 mysql编码 、web服务器编码 这三种编码是否一致。
在jdbc:mysql://127.0.0.1:3306/test后面加上 :
?useUnicode=true&characterEncoding=utf8
本文详细解析了在连接MySQL数据库时遇到的字符集问题:Unknowninitialcharactersetindex‘255’receivedfromserver。文章提供了具体的解决方案,即通过在JDBC连接字符串中添加?useUnicode=true&characterEncoding=utf8来强制指定字符集为UTF-8,确保程序编码、数据库编码和web服务器编码的一致性。
3529

被折叠的 条评论
为什么被折叠?



