Unable to import database

Discussion in 'MySQL' started by danmon, Jan 24, 2012.

  1. #1
    Am getting an error when importing a database into a new hosting.

    Error
    SQL query:
    
    -- ----------------------------
    -- Table structure for `wp_commentmeta`
    -- ----------------------------
    DROP TABLE IF EXISTS  `wp_commentmeta` ;
    
    
    MySQL said: 
    
    #1046 - No database selected
    Code (markup):
    Can anyone help me why this is happening.
    Thanks
    D
     
    danmon, Jan 24, 2012 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    DROP table deletes a table from the database. If the table you are trying to delete doesn't exist it will throw an error.
     
    jestep, Jan 24, 2012 IP
  3. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #3
    Well, that is not the issue because he wrote 'DROP TABLE IF EXISTS'

    The issue is that 'No database selected' - I guess you can read and understand English? Good. Then please read it again---- > No database selected

    Well, what could that mean? ;)
     
    GMF, Jan 24, 2012 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    Shoot didn't see that.

    Probably need to add:

    use your_wordpress_database_name;

    at the top of the script.
     
    jestep, Jan 24, 2012 IP
  5. danmon

    danmon Active Member

    Messages:
    364
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    78
    #5
    Thanks for the replies guys.
    I figured it out and managed to get my job done :)
     
    danmon, Jan 24, 2012 IP
  6. sachin410

    sachin410 Illustrious Member

    Messages:
    6,422
    Likes Received:
    573
    Best Answers:
    0
    Trophy Points:
    410
    #6
    I am facing the same problem.

    I am still not able to import.

    What exactly did you do?
     
    sachin410, May 12, 2012 IP