Trying to Restore DB- Getting Error 1062

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
eyal8r
Registered User
Posts: 30
Joined: Mon Apr 21, 2008 5:57 pm

Trying to Restore DB- Getting Error 1062

Post by eyal8r » Tue Aug 10, 2010 8:40 pm

Hey Guys-
I'm trying to restore my DB into a clean install. I am getting this error-

SQL query:

-- -- Dumping data for table `phpbb_acl_options` -- INSERT INTO `phpbb_acl_options` (`auth_option_id`, `auth_option`, `is_global`, `is_local`, `founder_only`) VALUES (1, 'f_', 0, 1, 0), (2, 'f_announce', 0, 1, 0), (3, 'f_attach', 0, 1, 0), (4, 'f_bbcode', 0, 1, 0), (5, 'f_bump', 0, 1, 0), (6, 'f_delete', 0, 1, 0), (7, 'f_download', 0, 1, 0), (8, 'f_edit', 0, 1, 0), (9, 'f_email', 0, 1, 0), (10, 'f_flash', 0, 1, 0), (11, 'f_icons', 0, 1, 0), (12, 'f_ignoreflood', 0, 1, 0), (13, 'f_img', 0, 1, 0), (14, 'f_list', 0, 1, 0), (15, 'f_noapprove', 0, 1, 0), (16, 'f_poll', 0, 1, 0), (17, 'f_post', 0, 1, 0), (18, 'f_postcount', 0, 1, 0), (19, 'f_print', 0, 1, 0), (20, 'f_read', 0, 1, 0), (21, 'f_reply', 0, 1, 0), (22, 'f_report', 0, 1, 0), (23, 'f_search', 0, 1, 0), (24, 'f_sigs', 0, 1, 0), (25, 'f_smilies', 0, 1, 0), (26, 'f_sticky', 0, 1, 0), (27, 'f_subscribe', 0, 1, 0), (28, 'f_user_lock', 0, 1, 0), (29, 'f_vote', 0, 1, 0), (30, 'f_votechg', 0, 1, 0), (31, 'm_', 1, 1, 0), (32, 'm_approve'[...]

MySQL said:

#1062 - Duplicate entry '1' for key 1

I don't know mysql very well at all. I'd appreciate any help you can provide!
Thanks!

User avatar
AmigoJack
Registered User
Posts: 5659
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Trying to Restore DB- Getting Error 1062

Post by AmigoJack » Tue Aug 10, 2010 8:47 pm

Search every line which starts like

Code: Select all

INSERT INTO `phpbb_xxx` (...
Before, insert a line like this, but only do this once! Also if you find the line above multiple times:

Code: Select all

DELETE FROM `phpbb_acl_options`;
The error is trying to say you, that your data you try to restore already exists. If you really want to write it, you first have to remove the existing one, which DELETE does.

But whatever you do is no full restore, as you only have a datadump. but you should re-create the tables aswell.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

eyal8r
Registered User
Posts: 30
Joined: Mon Apr 21, 2008 5:57 pm

Re: Trying to Restore DB- Getting Error 1062

Post by eyal8r » Tue Aug 10, 2010 9:04 pm

Hey- thanks for the fast reply. I sorta follow you. I'm unclear as to what I need to do to fix it tho? Should I delete a certain row/record in a table, then re-import the sql file again? Delete ALL tables and then reimport the file?

Again, I appreciate all your help!

eyal8r
Registered User
Posts: 30
Joined: Mon Apr 21, 2008 5:57 pm

Re: Trying to Restore DB- Getting Error 1062

Post by eyal8r » Tue Aug 10, 2010 9:11 pm

Let me clarify- this is a brand new install. The only record in there would be from the install process, say, my admin user name/record, etc. There's no other data in this install. So can I just delete all the tables of this new one, import this file, and it be ok?

User avatar
AmigoJack
Registered User
Posts: 5659
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Trying to Restore DB- Getting Error 1062

Post by AmigoJack » Wed Aug 11, 2010 6:46 am

eyal8r wrote:Let me clarify- this is a brand new install. The only record in there would be from the install process, say, my admin user name/record, etc.
This is impossible - phpBB3's installation does not interfere with anything else and sets up all necessary database info itself. There would be no need for you to use any datadump, so you must have done / want to do something else.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Locked

Return to “[3.0.x] Support Forum”