How can I generate SQL inserts with hex (blob) content for e.g. a Flyway migration script.
I can open the binary content in an editor, e.g. UltraEdit using Hex mode. However, cannot find a way to copy and paste this content to my SQL editor, e.g. MySQL Workbench. I can copy a few bytes, but the files I need are around 60k to 100k.
Suggestions please anyone?
After talking to colleagues here, tried this quick process and verified it works OK:-
Using MySQL Workbench, right click on the blob field and “Load Value From File” with the new content.
On command line (DOS or Cygwin), use the mysqldump utility, e.g.
mysqldump -u root -psomestring –hex-blob my_schemaname my_tablename > destination_file.sql
Open resulting destination_file.sql, copy and paste hex content strings to Flyway script.
QED