Wednesday, September 03, 2008

Mysql dump with blob

While working with Mysql database with blob, we encountered a problem. The database was populated from a source, then mysqldump was used to create dump file, which was imported on another machine. The java code to read this database suddenly started failing with following exception.

Could not convert byte array to object
java.io.StreamCorruptedException: invalid stream header


The problem was with blob we were storing in the db. After adding "--hex-blob" option, mysqldump created a clean dump which worked smoothly.

Asides. As a general practice I put the error message as google search query to get the solution quickly. In this case, it backfired as I was sent on a wild goose chase in java jungle.

Labels: ,


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]