MySQL server has gone away

When restoring a MySQL database, i get error “MySQL server has gone away”.

# mysql -u root -p'serverok123' sok_wp < backup.sql
ERROR 2006 (HY000) at line 5095: MySQL server has gone away
# 

To fix this, edit MySQL configuration file. Add following line under [mysqld] section.

max_allowed_packet = 256M

Restart MySQL

systemctl restart mysql

If you use MariaDB

systemctl restart mariadb

Related Posts

MySQL

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *