# Logstash MySQL pakcet too large exception

**URL:** <https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541>\
**Category:** Logstash\
**Created:** [June 30, 2022, 7:36am UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541 "2022-06-30T07:36:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simone1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone1/32/97834_2.png) [@Simone1](https://discuss.elastic.co/u/Simone1)\
**Post date:** [June 30, 2022, 7:36am UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541/1 "2022-06-30T07:36:46Z")

</div>

I'm trying to retreive data from a remote MySQL Server through the 22 port and i receive this error:

```auto
[ERROR] 2022-06-29 15:21:37.081 [[main]<jdbc] jdbc - Unable to connect to database. Tried 0 times {:error_message=>"Java::ComMysqlJdbc::PacketTooBigException: Packet for query is too large (4739923 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable."}
[ERROR] 2022-06-29 15:21:37.095 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.

```

The query is with LIMIT 1 so i don't understande where is the size problem

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 1, 2022, 8:27pm UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541/2 "2022-07-01T20:27:31Z")

</div>

> [@Simone1](#):
>
> `(4739923 > 1048576)`

MySQL is set _max\_allowed\_packet_ limited to 1048576. Set a larger value like 10485760.  
`$> mysql --max_allowed_packet=10M`

---

<div class="post-metadata">

**Author:** ![Simone1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone1/32/97834_2.png) [@Simone1](https://discuss.elastic.co/u/Simone1)\
**Post date:** [July 4, 2022, 6:40am UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541/3 "2022-07-04T06:40:46Z")

</div>

So, it's a MySQL problem?  
I don't need to change settings on Logstash?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 4, 2022, 7:41pm UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541/4 "2022-07-04T19:41:50Z")

</div>

Yes, only MySQL side. Nothing on the LS side.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 1, 2022, 7:42pm UTC](https://discuss.elastic.co/t/logstash-mysql-pakcet-too-large-exception/308541/5 "2022-08-01T19:42:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
