SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry getting error messages when importing databases

    I have tried six times with two different sites to import a MySQL databse using phpmyadmin.

    im using various wordpress templates i created for multiple sites (a client has 3 sites that we want to have the same look, just different content or i use the same template to create multiple sites with similar layouts). Ive found in the past that the easiest way to do this is not only to copy the theme files but import the MySQL database as well - and make changes as necessary.

    so what i do is i export the original database, open the file in dreamweaver of textwrangler or something, run a find/replace on the urls (find: example1.com/blog | replace: example2.net/wp)
    i have done this multiple times without incident.

    Now suddenly i am getting errors like this:

    Picture_2.png

    or previously it was telling me that there something was duplicated and could not be implemented - i dont remember the exact error, i did not get a screenshot of that one.

    the strange thing is i just tried that one again (the one i did not have the screenshot for) and it worked perfectly, just as it has so many times before.

    now the one i have the screenshot for, that was exported from godaddy, and i attempted to import it to a register.com hosting - but as far as i know (i know almost nothing about SQL) that shouldnt matter.

    anyone understand my babble here? anyone have an idea of why im getting these errors?

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you look through the files you'll likely see some lines near the beginning that specify the user that created the tables. you can just remove those lines. then they should load fine.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    San Sebastian, Spain
    Posts
    93
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The database information_schema is an internal (system) database. It looks like you took a full database backup and are attempting to restore it. I would suggest backing up one database and restore that single database.

  4. #4
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok here is the error message im getting:
    sql-error.png

    how can i get around this?

  5. #5
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,069
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Drop the existing table and then import it. Next time have your backup include the DROP IF EXISTS option.
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  6. #6
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    Drop the existing table and then import it. Next time have your backup include the DROP IF EXISTS option.
    I must be missing something bc i dropped this section:
    Code:
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `wp_commentmeta`
    --
    
    CREATE TABLE `wp_commentmeta` (
      `meta_id` bigint(20) unsigned NOT NULL auto_increment,
      `comment_id` bigint(20) unsigned NOT NULL default '0',
      `meta_key` varchar(255) default NULL,
      `meta_value` longtext,
      PRIMARY KEY  (`meta_id`),
      KEY `comment_id` (`comment_id`),
      KEY `meta_key` (`meta_key`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
    
    --
    -- Dumping data for table `wp_commentmeta`
    --
    
    
    -- --------------------------------------------------------
    and i go the same error but for wp_comments

    so then i tried dropping that section as well but i got an error for something else.

  7. #7
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,069
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I meant for you to drop the tables that exist on the new Database you are importing to (assuming they have no data in them at this point in time). Then you should be able to import your backup successfully.

    The problem is, the tables already exist in your new database, and the script you are trying to restore isn't accounting for that situation.
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •