- mysql数据库的批量update需要在URL处添加:allowMultiQueries=true
没有设置的话,无法批量更新、插入数据。
- 出现下图报警信息。
原因:MySQL在高版本需要指明是否进行SSL连接,这里不需要使用SSL:useSSL=false
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
- 是否使用Unicode字符集,并且设置为UTF-8:useUnicode=true&characterEncoding=UTF-8
发现没有设置这个的话,数据库里保存的数据显示是"?",因为数据库里设置成UTF-8格式。之前旧版本的数据不要如此设置,所以以后更新数据库版本的时候要注意此情况。
则项目中的基本设置目前为下图中
-
url: jdbc:mysql://***.**.**/coffee_roaster?useSSL=false&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8