A fatal MySQL error occurred.

Query:
SELECT pmd_menu_links.*, IF(pmd_menu_links.page_id != 0, IF(1, CONCAT('https://www.findlocal-plumber.com/pages/',friendly_url,'.html'), CONCAT('https://www.findlocal-plumber.com/page.php?id=',pmd_pages.id) ), IF(INSTR(link,'://'), link, CONCAT('https://www.findlocal-plumber.com/',link) ) ) as url, target FROM pmd_menu_links LEFT JOIN pmd_pages ON pmd_menu_links.page_id=pmd_pages.id WHERE parent_id=0 AND active=1 AND logged_out=1 ORDER BY ordering

Error:
(2006) MySQL server has gone away

A fatal MySQL error occurred.

Query:
REPLACE INTO pmd_sessions VALUES ('2c004e0f1222c68f2b958dfce5802fb6','E2S-UcOGHHElJ9R651hYCf41OTBsG1ni9jbII0tdS8M.',1627375555,'6dd03569987ec6ef3ab54aa7d5f0f393')

Error:
(2006) MySQL server has gone away