Print

Print


Can somebody here help me with the MySQL dump syntax?

On a more technical note, I am in the process of enhancing my Getting
Started With XML workshop:

   1. http://infomotions.com/musings/getting-started/LAMP.txt
   2. http://infomotions.com/musings/getting-started/shining.txt

In the most techno-weenie section, the second one above, I outline how
to use LAMP (Linux, Apache, MySQL, Perl) technologies to do XML stuff.
In the MySQL section I want to illustrate how to dump blob data from a
table into a file, but my illustration doesn't work because the dumped
data is escaped (I think).

More specifically, I have a MySQL table where one of the fields is a
blob. The field contains JPEG data. I want to use this command to dump
this blob to a file and then display the image in a JPEG reader:

   SELECT image INTO DUMPFILE '34.jpeg' FROM waters WHERE water_id = 34

MySQL does dump the file, but the file (34.jpeg) is unreadable. I know
the data in the field is valid, because I use it and another other data
to implement my online water collection:

   http://infomotions.com/water/

How do I modify the INTO DUMPFILE clause to make sure the dumped file
is readable?

--
Eric Lease Morgan