数据库版本:MySQL5.5.56
源代码如下:
<!-- default-config 默认的配置, -->
<default-config>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost/vvcat?serverTimezone=GMT%2B8</property>
<property name="user">root</property>
<property name="password">123456</property>
<property name="initialPoolSize">10</property>
<property name="maxIdleTime">30</property>
<property name="maxPoolSize">100</property>
<property name="minPoolSize">10</property>
<property name="maxStatements">200</property>
</default-config>
应该改为
- serverTimezone=GMT%2B8&:为设置时区
- useUnicode=true&characterEncoding=utf-8:设置数据连接传输格式为utf-8
?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8
<!-- default-config 默认的配置, -->
<default-config>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost/vvcat?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8</property>
<property name="user">root</property>
<property name="password">123456</property>
<property name="initialPoolSize">10</property>
<property name="maxIdleTime">30</property>
<property name="maxPoolSize">100</property>
<property name="minPoolSize">10</property>
<property name="maxStatements">200</property>
</default-config>
数据库设置为utf-8格式
数据库表格式设置为utf-8格式