I have added the following in the my.cnf as follows
[mysqld]
max_allowed_packet=32M
[mysql]
max_allowed_packet=32M
And I have also added the following to the JDBC query as well
jdbc:mysql://hostname:3306/databaseName?autoReconnect=true&characterEncoding=UTF-8&max_allowed_packet=33554432
But I'm still getting the error mentioned in the subject.
Best Regards, Ramindu.