spring连接数据库mysql报错 state 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
spring连接数据库mysql报错errorCode0,state08S01com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
问题描述
运行项目的时候,一直报错,连接不上数据库

原因分析:
经过许多检查,语句以及jdbc的配置,和获取数据库连接都没有问题
最后确定在可能是版本的问题
经过尝试,确实是版本的问题,我的Mysql是5.5的,然后连接驱动配的是5.1.47,不支持将连接驱动的版本调低即可
解决方案:

将其改为5.0.8版本即可连接数据库成功,修改之后记得重新加载pom文件
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.8</version>
</dependency>
spring连接数据库mysql报错 state 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException的更多相关文章
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 数据库报错
-- 查询mysql 数据库链接空闲时间持有最大空闲时间,单位为秒 SHOW VARIABLES WHERE VAriable_name = 'interactive_timeout'; -- 会出现 ...
- 【small项目】MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link ...
- 问题记录——com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
最近在搞一个Spring boot + Mybatis + Mysql的项目,用Mybatis访问数据库时,报了如下的错误,先在网上搜索了,试了各种办法都不行, 奇葩的是,连接另外1个数据库又没问题. ...
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解决
感谢大佬:https://blog.csdn.net/a704397849/article/details/93797529 springboot + mybatis多数据库 + druid连接池配置 ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
很长的报错,截取 ERROR c.a.d.p.DruidDataSource - discard connection com.mysql.jdbc.exceptions.jdbc4.Comm ...
- mysql 5.1超过默认8小时空闲时间解决办法(错误:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure)
报错: MySQL第二天早上第一次连接超时报错, com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications lin ...
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 78,050,512 milliseconds ago.
今天访问已经架上服务器的网站,报错: Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet s ...
- troubshooting-sqoop 导出 TiDB表数据报com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
2019-11-22 17:15:27,705 FATAL [IPC Server handler 13 on 44844] org.apache.hadoop.mapred.TaskAttemptL ...
- mysql 数据库问题com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
本文转自:http://blog.csdn.net/zmzsoftware/article/details/6835604 MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc ...
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解决办法
09:00:30.307 [http-8080-6] ERROR org.hibernate.transaction.JDBCTransaction -JDBC begin failed com.my ...
随机推荐
- MQTT(EMQX) - Java 调用 MQTT Demo 代码
POM <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse ...
- pywin32获取键盘状态,附带键位码
import win32apiimport win32con win32con.VK_CAPITAL # 20获取Caps Lock键编码 win32api.GetKeyState(win32con. ...
- python医学病理图片svs装换
SVS文件是什么? 最开始拿到SVS文件一脸懵逼的,这货长这样(在windows下可以用Aperio ImageScope这个开源软件打开): 我现在接触的这种图片的大小一般在60M-1.5G之间,可 ...
- cf1809e(edu145e)
1 /* 2 _ooOoo_ 3 o8888888o 4 88" . "88 5 (| -_- |) 6 O\ = /O 7 ____/`---'\____ 8 .' \\| |/ ...
- InnoDB引擎之flush脏页
利用 WAL 技术,数据库将随机写转换成了顺序写,大大提升了数据库的性能,由此也带来了内存脏页的问题. 脏页会被后台线程自动 flush,也会由于数据页淘汰而触发 flush,而刷脏页的过程由于会占用 ...
- 记一次python写爬虫爬取学校官网的文章
有一位老师想要把官网上有关数字化的文章全部下载下来,于是找到我,使用python来达到目的 首先先查看了文章的网址 获取了网页的源代码发现一个问题,源代码里面没有url,这里的话就需要用到抓包了,因为 ...
- 获取电脑的网络连接状态(四)IPHost
网络连接判断,使用IPHost测试获取: 1 public static bool IsIPHostConnected() 2 { 3 try 4 { 5 System.Net.IPHostEntry ...
- Selenium 打包为.exe执行
前言:不依赖环境执行,拓展UI自动化使用的场景 一.项目结构介绍 case:测试用例次存放目录 config:主要存放yaml文件配置 ele:元素的定位以及执行动作 tools:HTMLTestRu ...
- SpringCloud之Nacos学习使用
文章目录 Nacos 注册中心 核心功能 配置启动 集群搭建 Nacos是SpringCloudAilibaba提供的开源组件,有了Nacos我们就可以代替Eureka和SpringCloudConf ...
- 高级Java程序员必问,Redis事务终极篇
1. 简介 1.1 什么是Redis事务 Redis事务(Transaction)通过将多个Redis操作封装为一个原子性的操作序列,确保在事务执行过程中,不会受到其他客户端的干扰.从而在保证数据一致 ...