MySQL Forums
Forum List  »  Newbie

Question on restoring data - header of sql problem
Posted by: star dotstar
Date: May 11, 2005 05:01AM

Hi all,

I am moving a phpBB forum from one site to another and I have exported the entire database structure and all to a gzipped sql file.

After Ftp'ing it to my new server and ungzipping it I have run into something I don't understand...

If there is a database created called phpbb_mysql then when I execute:

mysql php_mysql < backupdatabase_mysql -u myuser -p

I get told that the database already exists.

So I enter mysql and drop the database php_mysql

Then I re-execute:

mysql php_mysql < backupdatabase_mysql -u myuser -p

and this time I get:

ERROR 1049: Unknown database 'archeli_mysql'

So I have to vi the sql and comment out CREATE DATABASE as shown in the following:

-- phpMyAdmin SQL Dump
-- version 2.6.0-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 11, 2005 at 07:33 PM
-- Server version: 3.23.58
-- PHP Version: 4.3.10
--
-- Database: `phpbb_mysql`
--
--CREATE DATABASE `phpbb_mysql`;
USE archeli_mysql;

then I have to recreate phpbb_mysql as an empty database and then run
mysql php_mysql < backupdatabase_mysql -u myuser -p

and it all works...

What am I missing here - why does the

CREATE DATABASE `phpbb_mysql`;

not work in the sql??? Is there a better way to export the database to start with??

TIA

Will

Options: ReplyQuote


Subject
Written By
Posted
Question on restoring data - header of sql problem
May 11, 2005 05:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.