---
title: "MySQL server has gone away"
author: "hacker507"
date: "2020-03-05T15:22:22Z"
tags: []
categories: ["数据库"]
slug: "mysql-server-has-gone-away"
draft: false
lastmod: "2020-03-05T15:22:22Z"
id: 2512816
url: "https://hacker507.iteye.com/blog/2512816"
---

第一种方法：修改配置文件 max_allowed_packet = 128M
检查是否修改成功 
show global variables like 'max_allowed_packet'; 

set global max_allowed_packet=1024x1024x16; 这里数值得计算出来