I'm using this method to insert a large blob into my mySQL database (Blob size ~40MB) After ~15 seconds it throws a exception. The whole thing here works with blobs smaller then ~20MB.
protected override int internalExecuteInt(string SQL, byte[] Blob)
{
using (MySqlCommand cmd = new MySqlCommand(SQL, connection))
{
if (Blob != null)
{
cmd.CommandTimeout = 600;
cmd.Parameters.AddWithValue("@blob", Blob);
}
return cmd.ExecuteNonQuery();
}
}
...
internalExecuteInt("INSERT INTO images (image) VALUES (@blob)", myLargeBlob);
...
Exception:
MySqlException: Fatal error encountered during command execution.
Inner exception:
SocketException: An existing connection was forcibly closed by the remote host
I have already changed net_read_timeout (600), net_write_timeout (600), wait_timeout (28800), slave_net_timeout (3600) and interactive_timeout (28800).
The "image" column is a LONGBLOB