当前位置:网站首页>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
边栏推荐
- Design and implementation of redis (1): understand data structures and objects
- ROS series (IV): ROS communication mechanism series (6): parameter server operation
- Identificateur, mot - clé, type de données
- Oracle JDK vs OpenJDK
- 51 single chip microcomputer: D / a digital to analog conversion experiment
- 標識符、關鍵字、數據類型
- [microservices] (x) -- Unified gateway
- Common auxiliary classes
- According to the category information and coordinate information of the XML file, the category area corresponding to the image is pulled out and stored in the folder.
- Laboratory safety examination
猜你喜欢
【ICCV 2019】MAP-VAE:Multi-Angle Point Cloud-VAE: Unsupervised Feature Learning for 3D Point Clouds..
ROS series (4): ROS communication mechanism series (4): topic communication practice
Qt程序集成EasyPlayer-RTSP流媒体播放器出现画面闪烁是什么原因?
[microservices] (x) -- Unified gateway
The whole process of connecting the newly created unbutu system virtual machine with xshell and xftp
Now is the best time to empower industrial visual inspection with AI
SQL learning record
ROS series (IV): ROS communication mechanism series (1): topic communication
Cuda11 is installed perfectly in win10 X + pytorch 1.9 (blood flowing into the river) cuda. is_ Available() becomes true!
MySQL is completely uninstalled and MySQL service is cleaned up
随机推荐
The great gods in acmer like mathematics very much
Use of rotary selector wheelpicker
[AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022
ROS series (V): common commands in ROS
Why is it necessary to divide the variance by 255^2 when adding Gaussian noise using the imnoise function of MATLAB
伦敦银最新价格走势图与买卖点
Solve the technical problems in seq2seq + attention machine translation
Detailed explanation on the use of annotation tool via (VGg image annotator) in mask RCNN
Basic usage of Google colab (I)
QT program integration easyplayer RTSP streaming media player screen flicker what is the reason?
【ICCV 2019】MAP-VAE:Multi-Angle Point Cloud-VAE: Unsupervised Feature Learning for 3D Point Clouds..
Digital image processing third edition Gonzalez notes Chapter 2
Writing latex with vscode - the latest tutorial 2022 / 4 / 17
现货黄金操作技巧_估波曲线
Vscode delete uninstall residue
Common net HP UNIX system FTP server listfiles returns null solution.
Design and implementation of redis (5): master-slave replication strategy and optimization
[AI vision · quick review of NLP natural language processing papers today, issue 28] wed, 1 Dec 2021
Design and implementation of redis (6): how redis achieves high availability
基于PHP的代步工具购物商城