Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
从错误的提示信息中发现字符集设置出现问题
mysql连接数据库时报此错误:
//String url = "jdbc:mysql://localhost:3306/db_cjky" 如果使用这句就会报错。
//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_cjky?useUnicode=true&characterEncoding=utf8";//改成这句,就可以了
————————————————
版权声明:本文为CSDN博主「txwtech」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/txwtech/article/details/80787886