title: Import hex/binary data into mysql
body: <p>I need to import into a mysql server (5.5) a set of large data having one field as a blob. Following the samples of SELECT INTO OUTFILE and LOAD DATA INFILE, it works [almost] fine. However, I have a problem: the generated data in the file for the BLOB has its actually binary representation. The generated file looks like this (3rd column represents the BLOB one):</p>
  
  <pre>
  1,1,"4Vÿ"
  2,1,"ª»Ì"
  3,1,"Ýîÿ"
  4,1,"\"3"
  </pre>
  
  <p>and the import works fine for this case with the following sql statement:</p>
  
  <pre>
  LOAD DATA INFILE 'C:/temp/mysql/mysqldump.1.txt'
  INTO TABLE `test_table`
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\r\n'
  ;
  </pre>
  
  <p>My problem is that the text is generated by chance like this. If quotes occur, or new-line, or whatever, I will need to do the escaping manually (i.e. replace them with backslash-char) and I would like to skip this step. </p>
  
  <p>So, my question is: is there any way I can import a text file with the following format (BLOB stored as hexa):</p>
  
  <pre>
  1, 1, 0x123456FF
  2, 1, 0xaabbcc
  3, 1, 0xddeeff
  4, 1, 0x112233
  </pre>
  
  <p>with one single mysql statement?</p>
  
  <p><strong>Update</strong>: Forgot to mention - tried to import the text file with desired format directly with the LOAD DATA INFILE statement, and the result was actually storing the text '0x123456FF' in the BLOB file of the table.</p>