首页 > 其他分享 > Unknown initial character set index '255' received from server. Initial client character

Unknown initial character set index '255' received from server. Initial client character

时间:2022-11-24 16:00:55浏览次数:49  
标签:index set Unknown Initial character via 255

错误:

Caused by: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)

原因:

 

 

 

这是编码不匹配的原因,MySQL驱动和数据库字符集设置不搭配,默认字符集已从latin1变成utf8mb4,因而系统变量受到影响

解决办法:

在后面加上这样一段代码:

<property name="url" value="jdbc:mysql://localhost:3306/eesy_mybatis?characterEncoding=utf8"/>

解决了

 

标签:index,set,Unknown,Initial,character,via,255
From: https://www.cnblogs.com/dbconfig1/p/16922137.html

相关文章