当前位置:   article > 正文

Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions._failed to obtain jdbc connection; nested exception

failed to obtain jdbc connection; nested exception is com.mysql.cj.jdbc.exce

Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 解决方法

一、 5.7版本之前的 mysql连接驱动使用的是

com.mysql.jdbc.Driver
  • 1

二、 8.0版本之后的mysql连接驱动使用的是

com.mysql.cj.jdbc.Driver
  • 1

三、出现 Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 错误,8.0版本之后的url后需补充参数,结果如下:

jdbc:mysql://localhost:3306/spring6?useUnicode=true&characterEncodeing=UTF-8&useSSL=false&serverTimezone=GMT
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/976561
推荐阅读
相关标签
  

闽ICP备14008679号