Fixed mysql has gone away error by disabling innodb_file_per_table option.