SQL will NOT import, Outrageous

5 replies
Hi,

So I bought a wordpress site that comes with all the content and everything, and when I unzipped it it only came with:

  • wp-content directory
  • wp-config.php
  • an image directory
  • plrboy.sql
I'm not a pro with this kind of stuff so I just uploaded wordpress on my domain with Fantastico and then used my FTP client to replace the wp-content directory. The site is up and is fine here with the plugins and theme activated:

basketballmoviesandvideos.com

Now I need the content and I know I am supposed to use the SQL file. But every time I import it using Myphpadmin on cpanel it wont work. I am uploading it to the right place too.

Here is the error I am getting:
Error

SQL query:
--
-- Dumping data for table `wp_comments`
--
INSERT INTO `wp_comments` ( `comment_ID` , `comment_post_ID` , `comment_author` , `comment_author_email` , `comment_author_url` , `comment_author_IP` , `comment_date` , `comment_date_gmt` , `comment_content` , `comment_karma` , `comment_approved` , `comment_agent` , `comment_type` , `comment_parent` , `user_id` )
VALUES ( 1, 1, 'Mr WordPress', '', 'http://wordpress.org/', '', '2010-05-03 18:50:39', '2010-05-03 18:50:39', 'Hi, this is a comment.<br />To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.', 0, 'post-trashed', '', '', 0, 0 ) ;


MySQL said:
#1062 - Duplicate entry '1' for key 'PRIMARY'


Any help would be much appreciated.

Thanks,

Augie Johnston
#import #outrageous #sql
  • Profile picture of the author lovenot
    Delete your old database table and recreate it again with the new one or remove the duplicated IDs.
    {{ DiscussionBoard.errors[4769564].message }}
  • Profile picture of the author jmartinez
    Most likely the sql file will import your entire database. I would import that file on a new empty database. Then configure wordpress to use that db. Open your wp-config.php file and see that the settings match. db name, db user, etc..
    {{ DiscussionBoard.errors[4770499].message }}
    • Profile picture of the author unnatural
      Sounds to me like your primary key is not auto-incrementing. Your primary key can not have any duplicate values, generally this is avoided by using MySQL's built in auto-incrementing feature, or it can be done from the program side as well.

      So, after one query gets executed the next one is failing as it's trying to insert a duplicate PRIMARY key.

      If you'd like you can add me on Skype and I can import it for you, or try to explain how to set it up properly.
      {{ DiscussionBoard.errors[4770706].message }}
  • Profile picture of the author mywebwork
    I'm pretty sure the first response nailed it, the OP was importing into an existing database table and not creating a new one.

    As for why it was "outrageous" I'm not sure!



    Bill
    {{ DiscussionBoard.errors[4770958].message }}
  • Profile picture of the author SteveJohnson
    I don't know if you have this sorted out yet, but the fix is simple. Go into your database manager (probably phpMyAdmin), select the WordPress database. On the page that lists the tables, go to the bottom and click the 'Select All' link. From the dropdown box, choose 'Empty' or 'Truncate' (some versions are different). Now re-import your file. You should be up and running.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[4777333].message }}

Trending Topics