我的是再宿主机连接虚拟机的时候报的这个错

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)... 71 common frames omitted
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82)at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68)at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338)at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java:88)at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:59)at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)... 77 common frames omitted
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:156)at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150)at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1580)at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:918)at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1300)at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1296)at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:109)at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:169)at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)... 87 common frames omitted
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:351)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.negotiateSSLConnection(NativeAuthenticationProvider.java:777)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:486)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:202)at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1442)at com.mysql.cj.NativeSession.connect(NativeSession.java:165)at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)... 103 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171)at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:101)at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238)at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394)at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:315)at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188)at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99)at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:347)... 110 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:61621', transport: 'socket'

。找了半天的错误,最后发现是因为url
jdbc:mysql://192.168.1.103:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=CST
把上面的useSSL改为false即可

Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsEx相关推荐

  1. Could not get JDBC Connection; nested exception is java.sql.SQLException:

    报错信息: Could not get JDBC Connection; nested exception is java.sql.SQLException: The server time zone ...

  2. Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driv

    解答 这种情况常见于直接打开jsp页面时ide报错,主要原因是不同意html这个静态页面,jsp它本身的特性导致其需要在运行的服务端下才可以打开. 所以打开前需要先启动tomcat等一类服务器,在服务 ...

  3. IDEA导入MySQL的jdbc驱动出现“java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver”

    目录 一.一般的解决思路 1.JDBC下载链接 2.选择下载内容,并进行下载 3.将驱动导入java项目 二.依然导入驱动失败怎么办 当我们在idea中使用java操作mysql数据库时会出现: Ex ...

  4. 成功解决 Cannot get Jedis connection; nested exception is redis.clients.jedis.excepti

    目录 一:配置redis密码 ​二:启动redis时读取本地配置(重要) 三:重启项目,再次重试 新拉取代码启动时redis报错 就开始检查问题. 一:配置redis密码 在redis中找到 redi ...

  5. 解决生产异常 Cause com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException Lock wait timeout exceed

    1.情景复现 早上起来发现自己的错误日志提醒疯狂提示,错误如下: ; Lock wait timeout exceeded; try restarting transaction; nested ex ...

  6. com.mysql.cj.jdbc.Driver连接失败解决办法

    com.mysql.cj.jdbc.Driver连接失败解决办法 com.mysql.cj.jdbc.Driver连接失败解决办法 (1)错误伊始 (2)怎么还是报错? (3)最终解决 com.mys ...

  7. 【JDBC】The new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically

    文章目录 前言 1.问题原图: 2.解决办法 前言 今天在使用JDBC连接mysql数据库时,在控制台报错: Loading class `com.mysql.jdbc.Driver`. This i ...

  8. springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

    问题一.springmvc运行时,Failed to read candidate component class:nested exception is java.lang.IllegalArgum ...

  9. 解决idea中报错Failed to read candidate component class file [ ]; nested exception is org

    解决idea中报错Failed to read candidate component class: file [ ]: nested exception is org. 使用的 Spring 依赖与 ...

最新文章

  1. android 三级界面返回直接到一级界面
  2. 数据结构与算法(6-4)线索二叉树
  3. linux命令之创建符号连接-ln
  4. 初中变成了菜园子了!
  5. 极通ewebs应用虚拟化系统v6.2完美上市
  6. php为首字母的词语,PHP提取中英文词语及数字首字母的简单示例
  7. A.1.3-控制台输入,类型转换(int.Parse()),格式化输出
  8. 【Oracle】数据库热备
  9. Mysql SQLyog 使用详解
  10. scratch3.0入门
  11. pygame网络游戏_7_1:地图编辑器的使用
  12. 网吧收银系统无法连接服务器失败,网吧收银系统pubwin修复网吧数据库出现一致性错误方法.docx...
  13. SSH工具连接谷歌云VPS实例
  14. 从30天到1天,专业视频制作背后的技术探索之路
  15. Windows 10简单搭建一个局域网Web下载分享界面
  16. 关于提取千位百位十位个位数字
  17. 代码何须全部自己写,融云守护程序猿发际线
  18. 软件著作权转让的流程是怎么样的
  19. Java — 内部类存在意义
  20. MultipartFile 转 File

热门文章

  1. 解决python利用openpyxl读取excel中公式结果值的问题
  2. win11桌面改成win7桌面的设置方法
  3. pr图形模板预设怎么使用_PR怎样安装动态图形模板?怎样调用Mogrt预设?Premiere导入MOGRTs预设完整教程...
  4. python爬虫——链家苏州成交房价2
  5. SLAM优秀开源工程大汇总
  6. 计算机无法安装64位操作系统,怎么看电脑能不能装64位系统|什么样的电脑可以装64位系统...
  7. 开篇“给自己定一个目标,明年7月去实现。希望不是一时的兴起。”
  8. 问题1201:打印数字图形
  9. 重置帆软决策系统用户名密码
  10. 国内有那些chia矿池,chia矿池排行那几家比较靠谱