-
--raw
I backup files stored in longblobs from one mysql server to another mysql server over the internet with ssh (file by file, not a whole table due to the size of the table):
ssh [email protected] -i /home/m/murk/.ssh/id_rsa mysql --batch --raw --user=murk --password=mysecret --database=logbuchBinary < select_statement_for_one_document.sql >> retrieved_longblob_document.sql
With html files this works well. But with PDF files stored as longblobs it retrieves only a very small part. If I leave out --raw, it retrieves the whole document, but has inserted \n, \0 and other escape characters, so it does not open as PDF. I tried with sed to filter out the added escapes, but with \0 I got stuck, so I want to solve this problem at its root.