MySQL BLOB data is gradually lost?

In the mysql table, MyISAMenter the Imagetype column mediumbloband save the captured image. I have interesting and problematic images. Some of the images are data gradually losing.

Field          type  
--------------------------
image         mediumblob

my.ini max allow packet size max_allowed_packet = 8M

image1image2image3

This is problem

When the application C#retrieves data from the server every time these images lose data gradually and randomly. I got 10-12bad images like this in 100000+image data.

What could be causing this behavior? Anyone have an idea / solution on how to fix / avoid this problem.

Update 1:
Reading Bytes of a PictureBox Form

MemoryStream ms = new MemoryStream();
byte[] ret = null;

try
{
     picturebox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
     byte[] Data = new byte[ms.Length];
     ms.Read(Data, 0, (int)ms.Length);
     ret = byteData;
     ms.Close();
 }         

blob.

byte[] Data = (byte[])reader["Image"];
+5
5

Culprit - MyISAM.

InnoDB -, . , ( 0,01%), InnoDB .

MyISAM, 20% , . , MyISAM , , -, .

MS SQL, InnoDB , , InnoDB . MS SQL express 10gb, 4-8gb, blob. .

, , , , , 100 . , 1000 . 10 db, , db . http://akashkava.com/blog/127/huge-file-storage-in-database-instead-of-file-system/

MongoDb, Hadoop, Azure Blob Store, Haystack Amazon S3.

+4

, , - ( - .

?

  • : , .
  • : / , , .
  • : , , . "".
  • / . , .

2 , : /xx/yy/filename, filename = md5 (+ , -), xx = 2 md5, yy = 3- 4- md5. , FS ( , 2 ).

, 3

  • . , . max_allowed_packet ~ 8 , mediub_blob 16 . , max_allowed_packet 32 . , , . , ( DB!), , .
  • - - , , - , , 1.
  • ( ). , → MySQL ( ). .
+5

, , - (backup/restore?), . , , (.. ), .

, , - , , , - , .

, , , BEFORE UPDATE , , . OLD NEW - , BLOB , .

+2

. , Blobs, , , . MSSQL, Sybase Faircom.

, , ( -), . .

- , (.. , ), , , .

+1

API ? , .

BLOBs - " ", , , , ADO.NET, .

This page may be useful: http://dev.mysql.com/doc/refman/5.5/en/connector-net-programming-blob.html

0
source

All Articles