3.问题:使用jdbc接口连接不上本地MySQL数据库

问题详情:Exception in thread "main" java.sql.SQLException: Unknown initial character set index '255' received from server. 
Initial client character set can be forced via the 'characterEncoding' property.
(从服务器接收到未知的初始字符集索引“255”。可以通过“characterEncoding”属性强制初始客户端字符集。)

分析:MySQL驱动和数据库字符集设置不匹配

解决方案:

直接在连接的URL后加上?useUnicode=true&characterEncoding=utf8就可以了


2019/1/22 14:24:10 已解决!