mysql升级8.0后项目不能连接问题

时间:2023-12-11 10:33:14

转载简书:https://www.jianshu.com/p/a164d582e5d9

  1. 主要是因为驱动配置变了driver中得用com.mysql.cj.jdbc.Driver,多了个cj;

  2. url后面serverTimezone=UTC必须加

  3. 驱动包最好也更新到最新版
 jdbc.drver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/dbname?useUnicode=true&useSSL=false&serverTimezone=UTC
jdbc.username=root
jdbc.password=123456