Unknown initial character set index ‘255’ received from server. Initial client character 解决方法
从错误的提示信息中发现字符集设置出现问题
Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.
从服务器接收到未知的初始字符集索引“255”。可以通过“characterEncoding”属性强制初始客户端字符集。
mysql连接数据库时报此错误:
//String url = “jdbc:mysql://localhost:3306/db_book” 如果使用这句就会报错。
//Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.
String url = “jdbc:mysql://localhost:3306/db_book*?useUnicode=true&characterEncoding=utf8*”;
?useUnicode=true&characterEncoding=utf8