Compare the following two commands:
mysqldump database_name --hex-blob -uuser_name -p | tee database_name_tee.sql mysqldump database_name --hex-blob -uuser_name -p > database_name_out.sql
If I run the first, on completion I see the following on my terminal:
Where does this come from? Does it suggest that something has gone wrong somewhere in the process? Are these control characters which are being output for some reason?
U+0C62 is Telugu Vowel Sign Vocalic L, which I’m pretty sure is not part of my data, so I don’t think this is Unicode. Anyway, the sequence seems to be not
62;c. This could be a control character of some kind. And whatever is causing it is included in the output file. If I later
database_name_out.sql, I again see this sequence once the
cat is complete.
tail database.sql -n200 does not produce this output;
-n300 produces just
$ 62;c62;c; and
$ 62;c62;c62;c62;c. So whatever is causing this is distributed throughout the file.
Mucking around with
tail, I found one of the culprits: a single line which, when saved to a separate file and printed with
$ 62;c62;c. My problem is that this single line is 1043108 bytes.
(The generated SQL file is perfectly fine, and runs without errors. I don’t think that this has anything to do with MySQL per se.)
I’m running the initial
mysqldump on a CentOS server, and am seeing the same effects from
cat on both the server itself and my Ubuntu desktop, so this seems to be a general Bash thing.
od -c problem_line produces 65174 lines of output, so I cut it down to a smaller section which demonstrates the same output (also available as a plain hexdump).