1.JDBC连接Mysql5
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
<scope>runtime</scope>
</dependency>
driver-class-name: com.mysql.jdbc.Driver
2.JDBC连接Mysql6
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
<scope>runtime</scope>
</dependency>
driver-class-name: com.mysql.cj.jdbc.Driver
提醒:不要小看一个cj.,这会直接导致是否连接数据库成功与否。