ERROR 1153 (08S01) at line 16985: Got a packet bigger than ‘max_allowed_packet’ bytes

While trying to restore a MySQL database I was getting the following error:

root@server [/var/lib/mysql]# mysql a24uall_data </home/username/dbuploaded.sql ERROR 1153 (08S01) at line 16985: Got a packet bigger than ‘max_allowed_packet’ bytes
To resolve this error:
In my.cnf file add the following line :
set-variable = max_allowed_packet=32M

And restart MySQL :

/etc/init.d/mysql restart