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

MyBatis configuration properties file reports an error:

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

solve:

The content of url in the xml configuration file is written as:

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

The content of the url in the properties file is written as:

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

Guess you like

Origin blog.csdn.net/qq_59942266/article/details/127791863