Tuesday, June 15, 2010

Import/Export BLOB data type correctly in MySQL database

MySQLDump is one of the built-in tools which is useful enough for data import/export on daily operation. To deal with complex data types like Binary or BLOB, it is good to export them in HEX code in order to avoid any invalid character set issue or corrupted data during data import.

MySQL manual has already mentioned about this:

--hex-blob

Dump binary columns using hexadecimal notation (for example, 'abc' becomes 0x616263). The affected data types are BINARYVARBINARY, the BLOB types, and BIT.


No comments:

Post a Comment