在XML文件中配置数据库的连接,复制

<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&characterEncoding=utf-8</property>

报错误:The reference to entity "characterEncoding" must end with the ';' delimiter.

原来是XML中需要将   “&”转义“&amp;”

上述代码改

<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&amp;characterEncoding=utf-8</property>

错误消失!