'EFcore 5, MySQL, longtext column, content greater 4 M(!)B raises error

I am using "EF core 5.0.9" and MySQL and have a table which contains also this column

`Blob` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci

Entities are writen/stored in the database as follows:

await context.SaveChangesAsync();

The saving works fine until the entity.blob value is greater than around 4 Mega(!)Bytes. Shown error message:
"An established connection was aborted by the software in your host machine."

The error is not content dependent but length dependent.
The error also occurs when the content is exchanged with more than 4 million 'x' characters.

Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source