How to fix mysql has gone away

I just wanted to add that I just ran into some similar errors in my logs today. I accidentally copied some large files to my system drive (which is very small) causing it to be 100% full. I didn’t realize it and ended up spending the last couple hours trying to troubleshoot the ‘mysql has gone away’ error only to find out that my system partition was full and it broke mariadb. So in my case the error was misleading.

Not saying this is the solution, but just something to consider.