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

Advertisement

systemctl restart mysql

If you use MariaDB

systemctl restart mariadb
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement