在mysql中增加max_allowed_pa​​cket后,每次从db加载长文本数据时,都会破坏会话以便我退出?

I increased the max_allowed_packet so I could save long text inside my database.

I did it by adding this line in my /etc/my.cnf: (default is 1M)

max_allowed_packet=5M

However, when I load the page which query the saved data. It destroyed my session so I would be signed out automatically!

When I delete the long text record from database. Everything is fine!

I guess there should be some kind of threshold for the query or something like this that need to be increased beside the max_allowed_packet. What did I miss!?

BTW, I use mysql on EC2 AWS.

UPDATE: I see in this thread they talk about changing two other variables:

net_buffer_length

And max_allowed_packet in client! Where can I change this one. Does it mean it depends on the configuration of clients !!

Do you think these two parameters are the problems?