View Full Version : phpMyAdmin importing a backup database error...
tomyknoker
02-13-2008, 07:45 AM
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?
Fumigator
02-13-2008, 08:45 AM
Does the file you are using to import contain the name of the database it came from on the SQL statements?
tomyknoker
02-13-2008, 08:52 AM
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...
-- 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?
Fumigator
02-13-2008, 05:01 PM
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.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.