If you're using Maven, add this to your pom.xml
:
(Recommended) For MySQL 5.6, 5.7, 8.x
and Java >= 8
use;
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.18</version>
</dependency>
(Legacy) For MySQL <= 5.5
or Java <= 7
or JDBC < 4.2
use;
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.48</version>
</dependency>
More details on Connector/J versions
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…