The error says '... server had gone away ...' which is probably the reason for the remainder of the error messages ... and the business about a temp table.
That error related to 'max_allowed_packet' in MySQL/MariaDB.
Technical info: http://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html
or you could just add a line to your my.cnf (config for MySQL/MariaDB on CentOS Linux) under the [mysqld] section thusly:
max_allowed_packet=500M
The value above a guess and one could probably do with 32M.
Restart mysqld and then TIA (try it again!)
'spirit of sharing', Ken