参考文章:https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away

cat /etc/my.cnf

sudo vim /etc/my.cnf

max_allowed_packet=500M

wait_timeout = 28800

# 8 hours

interactive_timeout = 28800

重启

sudo service mysqld restart