MySQL Import Error

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
User avatar
Surf3rDud3
A semi-regular
A semi-regular
Posts: 26
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Aug 23, 2013 9:02 am
Contact:

MySQL Import Error

Post by Surf3rDud3 »

I figured I wouldn't bother making a ticket. So here i am. I previously exported a few of my websites databases on my Xenforo Installations and was going to import them into newly created db's.

On two of my databases it throws the same errors when importing.

Code: Select all

#1062 - Duplicate entry '1' for key 'PRIMARY'
And most of the time my browser page just times out saying.

Code: Select all

The devrea.site.nfoservers.com page isn’t working

devrea.site.nfoservers.com didn’t send any data.
ERR_EMPTY_RESPONSE
I have another database with Xenforo on it and it imported fine.

If anyone is willing to take a look at the databases and maybe fix them I'll throw a little cash their way.
User avatar
Surf3rDud3
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Aug 23, 2013 9:02 am
Contact:

Re: MySQL Import Error

Post by Surf3rDud3 »

Here is the exact error:

Code: Select all

SQL query:


--
-- Dumping data for table `dark_postrating`
--

INSERT INTO `dark_postrating` (`id`, `post_id`, `user_id`, `rated_user_id`, `rating`, `date`) VALUES
(1, 14, 22, 1, 2, 1431621285),
(2, 29, 11, 9, 2, 1431843373),
(3, 29, 37, 9, 2, 1431846813),
(4, 29, 32, 9, 2, 1431886984);
MySQL said: Documentation

#1062 - Duplicate entry '1' for key 'PRIMARY' 
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: MySQL Import Error

Post by Markie »

How exactly are you importing? From the looks of your webserver I can see you have phpmyadmin installed, try truncating or dropping the table since it looks like there's data within the table already.

Code: Select all

TRUNCATE dark_prostrating;
-- only drop if you must, ensure value types are correct and make sure you're all backed up.

Code: Select all

DROP TABLE IF EXISTS dark_postrating;
CREATE TABLE dark_postrating (id int, post_id int, user_id int, rated_user_id int, rating int, date date);
Afterwards, go ahead and run your query;

Code: Select all

INSERT INTO dark_postrating (id, post_id, user_id, rated_user_id, rating, date) VALUES
(1, 14, 22, 1, 2, 1431621285),
(2, 29, 11, 9, 2, 1431843373),
(3, 29, 37, 9, 2, 1431846813),
(4, 29, 32, 9, 2, 1431886984);
User avatar
Surf3rDud3
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Aug 23, 2013 9:02 am
Contact:

Re: MySQL Import Error

Post by Surf3rDud3 »

I was actually able to fix the problem by just using HeidiSQL to import. For some reason phpMyAdmin was throwing the errors.

Thanks though.
Post Reply