• Hi,

    I switched hosts and am now trying to move my wordpress blog over to the new host. When I try to import the .sql file with mysqladmin I get an error message saying:

    Database d60155072 running on MySQL Server Farm 2 Error SQL-query :
    CREATE DATABASE d60155072
    MySQL said:
    Can’t create database ‘d60155072’. Database exists

    Is there something that I need to change in the .sql so that it doesnt try to create the d60155072 database, but instead just import the tables and data?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Open the sql dumpfile in a text editor and look for the CREATE line near the top:

    CREATE DATABASE d60155072;

    Just comment it out.

    -- CREATE DATABASE d60155072;

    Note that if it does not end in a semi-colon, check to make sure the query is not continued on multiple lines.

    Thread Starter dailyjapan

    (@dailyjapan)

    I think it looks like that already… here is what I have:

    PHP Version: 4.3.11

    — Database: d60155072

    CREATE DATABASE d60155072;
    USE d60155072;

    — ——————————————————–


    — Table structure [continued]

    That didnt paste very well, but when you look at the .sql in notepad, it has a — before create database. Do I need to add an extra — before that?

    PHP Version: 4.3.11
    --
    -- Database: d60155072
    --
    CREATE DATABASE d60155072;
    <—– Comment me!
    USE d60155072;

    PHP Version: 4.3.11
    --
    -- Database: d60155072
    --
    -- CREATE DATABASE d60155072;
    <—–Ah, thanks!
    USE d60155072;

    Thread Starter dailyjapan

    (@dailyjapan)

    Yeah that worked. Turns out there was also an invisible character in between the — and word create that I had to get rid of.

    Everything works just fine now. Thanks!

    Thanks for this post. I’ve just moved host and was struggling with import to a new database. Commenting out the ‘CREATE’ part did it for me.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Importing MySQL database’ is closed to new replies.