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