Ssh – PuTTY typing its name into the console

MySQLputtysshterminal

I was doing a MySQL dump over SSH using Putty, and now it is just typing PuTTY over and over again into the console, Ctrl+C doesn't do anything.

Does anyone know why this is happening?

PuTTYPuTTYPuTTY

Best Answer

Yes. Your mysql dump is not clear text, but contains terminal controlling characters as well. Practically, it contains binary data. You can experience the similar flash if you print any binary data into your screen, f.e. cat /bin/bash.

It shouldn't happen so. Some solutions:

  1. Check, where is the binary data in your mysql dump (I think, you had probably textual data with some non-ascii encoding).
  2. Convert your output encoding to UTF-7 (yes, UTF-7, not UTF-8!). The UTF-7 encoding is unicode too, but instead of the non-ascii bytes, it uses ascii-compatible sequences. It will only work if your mysql dump contains only valid utf8. It can be done by piping it to an iconv converter command: mysqldump ...|iconv -f your-actual-encoding-which-is-probably-utf-8 -t utf-7.
  3. Check the dump with a viewer capable to handle such problems. For example, vim is very good in binary data editing. If your problem was caused by big blobs, hexedit can be also useful.