当前位置:网站首页>Mysql出现2013 Lost connection to MySQL server during query
Mysql出现2013 Lost connection to MySQL server during query
2022-04-23 03:51:00 【撸BUG】
前因
因为需要写一个文件统一管理平台,需要实现文件上传,下载,预览等功能,Mysql实现文件的存储。使用QT开发UI功能。并成功上传文件(size<4);目前未发现也不知道当文件大于4M时mysql会报错
上线测试
因为自己测试上传的文件都是字节或kb大小;能够成功上传Mysql,没有考虑其他。
经过上线,会提示文件上传失败,然后就去查看错误提示:
QSqlError("2013", "QMYSQL3: Unable to execute statement", "Lost connection to MySQL server during query")
错误,服务器中断连接,
分析
因为有上传成功的例子,肯定不是代码问题,查看mysql配置,查询响应时间,查询数据最大值,默认为4M,经测试文件大于4M时将会出现错误,所以需要修改配置文件,
解决
mysql安装目录或者在系统盘搜素文件 my.ini并打开,
添加语句:
#大小自定义
max_allowed_packet=16M
位置
那么应该将该语句放到配置文件那个地方呢,
[mysql] 之后
or
[mysqld] 之后
两个地方都存放过 并重启Mysql服务,结果还是失败,
最后请将max_allowed_packet语句存放到配置文件末尾,重启服务即可实现上传
版权声明
本文为[撸BUG]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_45647036/article/details/124274694
边栏推荐
- The latest price trend chart and trading points of London Silver
- ROS series (V): common commands in ROS
- [latex] differences in the way scores are written
- RuntimeError: output with shape [4, 1, 512, 512] doesn‘t match the broadcast shape[4, 4, 512, 512]
- Oracle JDK vs OpenJDK
- ROS series (IV): ROS communication mechanism series (1): topic communication
- Design and implementation of redis (6): how redis achieves high availability
- [AI vision · quick review of NLP natural language processing papers today, issue 29] Mon, 14 Feb 2022
- Websites frequented by old programmers (continuously updated)
- 【NeurIPS 2019】Self-Supervised Deep Learning on Point Clouds by Reconstructing Space
猜你喜欢

Opencv4 QR code recognition test

ROS series (IV): ROS communication mechanism series (3): parameter server

Basic knowledge of convolutional neural network

STM32 advanced timer com event

Wechat applet canvas draws a simple asymptotic color of the dashboard

ROS series (4): ROS communication mechanism series (4): topic communication practice

What if you encounter symbols you don't know in mathematical formulas

中国移动日赚2.85亿很高?其实是5G难带来更多利润,那么钱去哪里了?

ROS series (IV): ROS communication mechanism series (2): Service Communication

Overview of knowledge map (II)
随机推荐
Variable definition and use
Process seven state transition diagram
vscode删除卸载残余
深度學習筆記(二)——激活函數原理與實現
Identificateur, mot - clé, type de données
SQL learning record
【ICCV 2019】MAP-VAE:Multi-Angle Point Cloud-VAE: Unsupervised Feature Learning for 3D Point Clouds..
A hundred dollars for a hundred chickens
Basic introduction to spot gold
秒杀所有区间相关问题
Design and implementation of redis (5): master-slave replication strategy and optimization
现货黄金操作技巧_估波曲线
【NeurIPS 2019】Self-Supervised Deep Learning on Point Clouds by Reconstructing Space
[microservices] (x) -- Unified gateway
使用大华设备开发行AI人流量统计出现时间不正确的原因分析
A sword is a sword. There is no difference between a wooden sword and a copper sword
Wechat applet canvas draws a simple asymptotic color of the dashboard
ROS series (II): ROS quick experience, taking HelloWorld program as an example
抽象类、接口、常用关键字
Win10 boot VMware virtual machine boot seconds blue screen problem perfect solution