I am running into the
DBD::mysql::st execute failed: Got a packet bigger than 'max_allowed_packet' bytes
error when trying to make a large insert using Perl & MySQL. I know that increasing the max_allowed_packet setting in my.cnf could fix this, but is it possible to tell DBI (or DBD::mysql, since my app really only needs to work with MySQL) to use smaller packets? Is it even possible to break up a large insert into smaller packets?
I don’t have full control over the database server, since this needs to run in a shared hosting environment, so if I could handle this without requesting a global change to the server, that would be ideal.
Thanks!
Try adding something like
';max_allowed_packet=1MB'to the fist argument of DBI->connect.If that doesn’t work, you could use a
';mysql_read_default_file=/somewhere/my.cnf'option pointing to a my.cnf file that has the proper configuration.