Post January 9th, 2010, 9:11 pm

Sending BLOBS with MySQL

By default, MySQL limits the size of the packets you send across. So, if you are using a Portus web service to send a large file, say a 1GB AVI, then you will hit an error something like this :

[MySQL][ODBC 3.51 Driver][mysqld-5.0.22]Got a packet bigger than 'max_allowed_packet' bytes

To solve this, you need to do some MySQL administration. Edit the my.cnf file , often found under /etc/my.cnf and in the mysqld section add

[mysqld]
. . .
max_allowed_packet = 2000M

to impose a 2GB limit.

Now restart your mysql daemon.

E.g.

sudo /etc/init.d/mysqld restart

Re-send your web service request, and it now should be sucessful.