Problem in restoring database

Discussion in 'Site & Server Administration' started by Davilac, Jun 12, 2005.

  1. #1
    I have only data's SMF backup and when I try restoring the database:

    Error SQL-query: # ========================================================== # # Database dump of tables in `davilac_davilacnet1` # Junio 12, 2005, 06:55:22 # # ========================================================== # # Dumping data in `smfforos_attachments` # INSERT INTO `smfforos_attachments` ( `ID_ATTACH` , `ID_MSG` , `ID_MEMBER` , `filename` , `size` , `downloads` ) VALUES ( 1, 837, 0, 'index.txt', 7585, 2 ) MySQL said: #1062 - Duplicate entry '1' for key 1 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/local/cpanel/base/blabla/phpMyAdmin/libraries/common.lib.php on line 685

    and when I push browse:

    SQL-query: SELECT * FROM WHERE LIKE '1' MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE LIKE '1'' at line 1

    I have phpMyAdmin 2.6.1-pl2 and MySQL version 4.0.24-standard
    how i can restore my backup?

    Thanks
     
    Davilac, Jun 12, 2005 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Looks like you have an error in your SQL syntax. Try:
    SELECT * FROM `some_table` WHERE 1
    Code (markup):
    If your back up has invalid SQL, you might try a global search and replace in a good text editor.
     
    exam, Jun 12, 2005 IP
  3. Davilac

    Davilac Peon

    Messages:
    233
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Al last i achived restoring the database by truncating all the tables and then uploading. Thanks ;)
     
    Davilac, Jun 13, 2005 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    So.. there were no errors in the SQL? I didn't think of truncating, because all the backups I have seen, automatically put a DROP table IF EXISTS before each table. Anyway, glad to hear you got it working.
     
    exam, Jun 15, 2005 IP