How do I move a database with binary content ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mariellef
    New Member
    • Jun 2007
    • 4

    How do I move a database with binary content ?

    I have moved to a more recent operating system. The staff of the hosting company did the move. They took an exact copy of the database and moved it.
    Problem: the binary blob-fields used to store images, can no longer be read as photo-files => photos are in correct proportions, but are a no-show (rectangle - in the right proportions - with red cross on the upper left corner).
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi, and welcome to TSDN!

    As far as I know, using "SELECT * INTO OUTFILE" and "LOAD DATA INFILE" should backup your data and restore it correctly.

    You could try this, just to see if it works. DO NOT however try this on data you don't want to lose untill you have tested it!
    [code=sql]
    /* Create backup */
    SELECT * INTO OUTFILE 'backup.txt' FROM myTbl;

    /* Truncate test table */
    TRUNCATE myTbl;

    /* Restore data */
    LOAD DATA INFILE 'backup.txt';

    [/code]

    Comment

    • Mariellef
      New Member
      • Jun 2007
      • 4

      #3
      Thank you for your reply, I will test this and let you know if it helped me.

      Comment

      • Mariellef
        New Member
        • Jun 2007
        • 4

        #4
        I get the error message in php that there is a "syntax error, unexpected T_STRING in /home/.../bedrijf_test.ph p" on line 15
        SELECT * INTO OUTFILE 'backup.txt' FROM foto_copie;

        Comment

        • Mariellef
          New Member
          • Jun 2007
          • 4

          #5
          errormessage that access is denied for my username.
          Is this way only preserved for the root ?

          Comment

          Working...