Unknown initial character set index ‘255‘ received from server. Initial client character解决方式

MyBatis配置properties文件时报错:

java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

解决:

xml配置文件中url的内容写为:

jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8

properties文件中url的内容写为:

jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8

猜你喜欢

转载自blog.csdn.net/qq_59942266/article/details/127791863
今日推荐