# Error with com.mysql.jdbc.PacketTooBigException

**URL:** <https://forum.inductiveautomation.com/t/error-with-com-mysql-jdbc-packettoobigexception/11430>\
**Category:** Ignition\
**Created:** [March 29, 2016, 4:59pm UTC](https://forum.inductiveautomation.com/t/error-with-com-mysql-jdbc-packettoobigexception/11430 "2016-03-29T16:59:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Antonio](https://forum.inductiveautomation.com/u/Antonio)\
**Post date:** [March 29, 2016, 4:59pm UTC](https://forum.inductiveautomation.com/t/error-with-com-mysql-jdbc-packettoobigexception/11430/1 "2016-03-29T16:59:15Z")

</div>

Hi,  
I got an error in this script and i don’t know how to fix it. The idea that i have is automatically send to one database the backups:

if system.file.fileExists("/home/antonio/Ignition-backup-20160327-0530.gwbk"):

```
bytes = system.file.readFileAsBytes('/home/antonio/Ignition-backup-20160327-0530.gwbk')
system.db.runPrepUpdate("INSERT INTO db.gw_backups (file) VALUES (?)", (bytes))

```

It should work but i got always an error

[color=#FF0000]Caused by: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO gw\_backups (fc,file) VALUES (?,?), [MAD4, [B@5c8e9657], MAD4\_SID, , false, false)  
… 24 more  
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (24039952 \> 16777216). You can change this value on the server by setting the max\_allowed\_packet’ variable.[/color]

I have tried to find this setting in the gateway but i couldn’t find it. Can you please help me?  
Thanks,  
Antonio

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 29, 2016, 5:06pm UTC](https://forum.inductiveautomation.com/t/error-with-com-mysql-jdbc-packettoobigexception/11430/2 "2016-03-29T17:06:19Z")

</div>

The ‘max\_allowed\_packet’ property is something you’ll find in MySQL, not Ignition.

[dev.mysql.com/doc/refman/5.7/en/ … large.html](http://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html)

---

<div class="post-metadata">

**Author:** ![Antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Antonio](https://forum.inductiveautomation.com/u/Antonio)\
**Post date:** [March 29, 2016, 5:22pm UTC](https://forum.inductiveautomation.com/t/error-with-com-mysql-jdbc-packettoobigexception/11430/3 "2016-03-29T17:22:46Z")

</div>

I just realized that, Sorry and thanks for your help
