MySQL server has gone away – how to get it back
Has MySQL/MariaDB server ever run away from you? If it hasn’t, you’re lucky or you’re likely to use PostgreSQL instead. Today I’m trying to restore a database from backup (database dump) onto a new MariaDB server. This is what happened: # mysql -u db_user -p db4 < db4-4.4.2_02-08-2018.sql Enter password: ERROR 2006 (HY000) at line 354: MySQL server has gone away The database size is 1.7G, and this should not surprised a database administrator. But it did surprise me because: firstly I’m not a db admin, and secondly I had this issue before just a few weeks ago. So here is a blog post to make sure I won’t forget it for the 3rd time. Basically, I just need to increase the max_allowed_packet size from the default 16MB to something bigger. I chose 128MB. ...