PDA

View Full Version : Database Import Issue



JeeBar
08-21-2008, 01:00 AM
I'm trying to move a wordpress blog from another hosting provider to Bluehost. I'm total noob at this, apologies for any idiocy and thanks in advance for any help.

1) I used the simplescripts installation to set up a new copy of the blog here at Bluehost. So far so good...directory and database all in place.

2) Using phpMyadmin over at the other place I "exported" to a .sql file.

3) But when I try to "import" that .sql file into the relevant database on the bluehost side of the equation I get the following error message:


Error

SQL query:

# phpMyAdmin SQL Dump
# version 2.5.2-pl1
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Aug 20, 2008 at 11:20 PM
# Server version: 4.1.11
# PHP Version: 4.4.8
#
# Database : `willowglench_blog`
#
CREATE DATABASE `willowglench_blog` ;

MySQL said: Documentation
#1044 - Access denied for user 'hollybar'@'localhost' to database 'willowglench_blog'

felgall
08-21-2008, 02:34 AM
You need to delete the create database statement from the file since the database already exists and you can't create extra databases that way on BlueHost hosting. The rest of the file should do what you need without that statement.

dataman
08-21-2008, 02:34 AM
Your databases have to be created in the C-Panel. Once done, then you can use the .sql script. Also, you will have to edit out the offending line in your input sql file before using it on the transfer.

DataMan

JeeBar
08-21-2008, 02:49 AM
So I removed the unnecessary/offending "create database" line and it got further along, but now it's running into offending similar "create table" lines.

It's saying that "wp_comments already exists." So following the logic of getting rid of the create database line, I need to get rid of the create table lines right? Seems like this is the offending line, it's at the beginning of each section.

CREATE TABLE `wp_comments` (

Based on the "hey try this" of the support guy I tried changing the line to
USE TABLE 'wp_comments' (

That generated the error
"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 'TABLE `wp_comments` ( `comment_ID` bigint(20) unsigned NOT NULL auto_incremen' at line 1

Doesn't seem like I can just delete the line because the import needs to know where to put the data in that section. What is the proper syntax for telling it where to put each section's data?

felgall
08-21-2008, 01:14 PM
Each insert contains the instructions on which trable to insert to. When creating a backup copy to move a database you should either include both drop and create statements for the tables OR if you know the tables already exist and are empty then leave them both out.