Springboot报错:Could not create connection to database server

今天遇到spring+mybatis报错说数据库连接失败,试了很多方法,我将jdbc连接驱动由5.x版本改成8.x就好了

Springboot报错:Could not create connection to database server

 

Springboot报错:Could not create connection to database server

 

并且url要这样写

url: jdbc:mysql://127.0.0.1:3306/user?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=UTC

后来百度了一下,发现数据库连接驱动的版本要与mysql的版本相同,例如我的mysql和连接驱动都需要时8.x
Springboot报错:Could not create connection to database server

 

 

 

 

 

Springboot报错:Could not create connection to database server

上一篇:php中的多种界面跳转方式


下一篇:linux下连接mysql数据库时提示“World-writable config file '/etc/mysql/mysql.conf.d/mysqld.cnf' is ignored”的解决办法