0

I've encountered a strange problem when I was using PuTTY to query the following MySQL command: select * from gts_camera

The output seems extremely weird: enter image description here

As you can see, putty outputs loads of "PuTTYPuTTYPuTTY..."

Maybe it's because of the table attribute set:

    mysql> describe gts_kamera;
+---------+----------+------+-----+-------------------+----------------+
| Field   | Type     | Null | Key | Default           | Extra          |
+---------+----------+------+-----+-------------------+----------------+
| id      | int(11)  | NO   | PRI | NULL              | auto_increment |
| datum   | datetime | YES  |     | CURRENT_TIMESTAMP |                |
| picture | longblob | YES  |     | NULL              |                |
+---------+----------+------+-----+-------------------+----------------+

This table stores some big pictures and their date of creation. (The weird ASCII-characters you can see on top of the picture is the content.)

Does anybody know why PuTTY outputs such strange stuff, and how to solve/clean this?

Cause I can't type any other commands afterwards. I have to reopen the session again.

Sincerely, Michael.

Michael Gierer
  • 401
  • 2
  • 6
  • 15

1 Answers1

3

The reason this happens is because of the contents of the file (as you have a column defined with longblob). It may have some characters that Putty will not understand, therefore it will break as it is happening with you.

There is a configuration that may help though. enter image description here

You can also not select every column in that table (at least not the *blob ones) as:

select id, datum from gts_camera;

Or If you still want to do it use the MySql funtion HEX:

select id, datum, HEX(picture) as pic from gts_camera;
Jorge Campos
  • 22,647
  • 7
  • 56
  • 87