Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    phpMyAdmin importing a backup database error...

    I have a database which I access through phpMyAdmin, I downloaded a copy of this database and have created a new database in phpMyAdmin, called backup. I am trying to upload the .sql file into this new database... But everytime I do that it gives me an error telling me these tables already exist in the database and it takes me to my current database, where yes those tables do exist, but I am definitely importing it into the back up, which is currently empty... Anyone know what it's doing? Or what I am doing wrong?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Does the file you are using to import contain the name of the database it came from on the SQL statements?

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ah too good Fumigator I think it may have something to with that... I can only seem to open this file in Word but I do see at the top this...

    Code:
    -- MySQL dump 9.11
    --
    -- Host: myhost.com    Database: db_nameofrealdatabase
    -- ------------------------------------------------------
    -- Server version	4.1.11-Debian_4sarge7
    
    --
    -- Current Database: db_nameofrealdatabase
    --
    
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_nameofrealdatabase;
    
    USE db_nameofrealdatabase;
    Think that's it? Should I change the 'db_nameofrealdatabase' to 'db_nameofbackupdatabase'? The thing is though how can I edit a .sql file? It seems to open in Word can edit it there and just save as .sql?

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Yeah that looks like what's causing the trouble. You could try removing the reference to the database altogether; I don't think it's needed as long as you are using phpMyAdmin to import.

    To edit the .SQL file just use your favorite text editor such as Notepad. Don't use Word; you don't want any extra control codes in the file.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •