jdbc的url:
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
参数介绍
参数名称 | 参数说明 |
---|---|
useUnicode | 是否使用Unicode字符集 |
characterEncoding | 当useUnicode设置为true时,指定字符编码。比如可设置为UTF-8或gbk |
useSSL | MySQL在高版本需要指明是否进行SSL连接 在mysql连接字符串url中加入ssl=true或者false即可 |
serverTimezone | 设置时区例如:serverTimezone=GMT%2B8(中国时区)或serverTimezone=Asia/Shanghai(中国时区) |