In my.cnf, you should have a parameter as follows:
# The MySQL server
[mysqld]
max_allowed_packet = 10M
After changing my.cnf, you have to stop and restart MySQL for the change to take effect.
(The 10M allows a 10MB file attachment into MySQL.)
Here is a great thread on ThreadsDev for tuning MySQL, which could help your overall forum performance as well.