前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MYSQL 一次更新BLOB数据报错SQLSTATE(08S01)处理

MYSQL 一次更新BLOB数据报错SQLSTATE(08S01)处理

作者头像
路过君
发布2021-10-15 15:14:36
4.2K0
发布2021-10-15 15:14:36
举报
文章被收录于专栏:路过君BLOG from CSDN

插入包含blob字段的记录时,blob数据超过一定大小(小于max_allowed_packet)时提交一段时间后报错如下:

2021-03-02 13:44:59.392 [http-nio-auto-1-exec-10] WARN com.zaxxer.hikari.pool.ProxyConnection - HikariPool-1 - Connection com.mysql.cj.jdbc.ConnectionImpl@127bc78a marked as broken because of SQLSTATE(08S01), ErrorCode(0) com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet successfully received from the server was 3,053 milliseconds ago. The last packet sent successfully to the server was 3,056 milliseconds ago. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure The last packet successfully received from the server was 3,053 milliseconds ago. The last packet sent successfully to the server was 3,056 milliseconds ago. at jdk.internal.reflect.GeneratedConstructorAccessor78.newInstance(Unknown Source) Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:67) 2021-03-02 13:44:59.392 [http-nio-auto-1-exec-10] WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 08S01 2021-03-02 13:44:59.392 [http-nio-auto-1-exec-10] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Communications link failure The last packet successfully received from the server was 3,053 milliseconds ago. The last packet sent successfully to the server was 3,056 milliseconds ago. 2021-03-02 13:44:59.398 [http-nio-auto-1-exec-10] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: could not execute statement; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute statement] with root cause java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:67)

查看MYSQL日志,发现服务自动重启

解决: 虽然容器内存负载并不高,但是增加容器负载内存配额后可以解决问题,提交更大的BLOB数据需要进一步增加内存配额,细节待查

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021/03/02 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档