数据库 常见问题

2018-06-17  本文已影响0人  海边的蜗牛ng
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.
This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The


Mysql6.0连接中的几个问题


user=root  
password=  
#old driver   
#driverClass=com.mysql.jdbc.Driver  
#new driver is as follow:  
driverClass=com.mysql.cj.jdbc.Driver  
jdbcUrl=jdbc:mysql://localhost:3306/spring?serverTimezone=UTC  

version >5.7.0
已经开始区分大小写了


maven 坐标
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>6.0.4</version>
</dependency>

### MySQL Connector/J 5.x   (旧版连接)
#jdbc.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8

### MySQL Connector/J 6.x   (新版连接)
jdbc.url=jdbc:mysql:///test?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false
### MySQL Connector/J 5.x   (旧版驱动)
#jdbc.driver_class=com.mysql.jdbc.Driver

### MySQL Connector/J 6.x   (新版驱动)
jdbc.driver_class=com.mysql.cj.jdbc.Driver
上一篇 下一篇

猜你喜欢

热点阅读