jar包下载地址: https://dev.mysql.com/downloads/connector/j/

或者 :http://central.maven.org/maven2/mysql/mysql-connector-java/

jar包的版本要与数据库的版本保持一致

在使用5.x的版本:

url =  "jdbc:mysql://localhost:3306/database_name"
驱动: com.mysql.jdbc.Driver

 

在使用8.x的版本时,要添加一些参数:

url = "jdbc:mysql://localhost:3306/database_name? characterEncoding=utf8 & useSSL=false & serverTimezone=UTC & rewriteBatchedStatements=true";

驱动: com.mysql.cj.jdbc.Driver

 

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-04-14
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-11-20
猜你喜欢
  • 2021-06-06
  • 2021-09-05
  • 2020-01-04
  • 2022-02-17
  • 2022-12-23
  • 2021-10-11
  • 2021-12-05
相关资源
相似解决方案