MyBB Community Forums

Full Version: DB Restore Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I reinstalled MyBB 1.6.5 after deleting the old one and now when I try to restore DB backup through the Import tab on phpMyAdmin it gives me the following error:

Error

SQL query:

-- -- Dumping data for table mybb_adminoptions -- INSERT INTO mybb_adminoptions (uid, cpstyle, codepress, notes, permissions, defaultviews, loginattempts, loginlockoutexpiry) VALUES (0, '', 1, '', 'a:5:{s:6:"config";a:17:{s:3:"tab";s:1:"0";s:8:"settings";s:1:"0";s:7:"banning";s:1:"0";s:14:"profile_fields";s:1:"0";s:7:"smilies";s:1:"0";s:8:"badwords";s:1:"0";s:6:"mycode";s:1:"0";s:9:"languages";s:1:"0";s:10:"post_icons";s:1:"0";s:14:"help_documents";s:1:"0";s:7:"plugins";s:1:"0";s:16:"attachment_types";s:1:"0";s:9:"mod_tools";s:1:"0";s:7:"spiders";s:1:"0";s:9:"calendars";s:1:"0";s:7:"warning";s:1:"0";s:15:"thread_prefixes";i:0;}s:5:"forum";a:6:{s:3:"tab";s:1:"0";s:10:"management";s:1:"0";s:13:"announcements";s:1:"0";s:16:"moderation_queue";s:1:"0";s:11:"attachments";s:1:"0";s:7:"akismet";i:0;}s:5:"style";a:3:{s:3:"tab";s:1:"0";s:6:"themes";s:1:"0";s:9:"templates";s:1:"0";}s:5:"tools";a:15:{s:3:"tab";s:1:"0";s:13:"system_health";s:1:"0";s:5:"cache";s:1:"0";s:5:"tas[...]

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

Please keep in mind I am a bit green.

Thanks.
Could anybody help please? What should I do to get around this problem?
Please help me!
Thanks!
Not sure why that happens, but you could try editing that line in the SQL dump and change INSERT INTO to REPLACE INTO

Make sure your DB is empty before importing a complete dump otherwise that'd be your reason for duplicate entries.

You may rename already existing tables instead of deleting them, if you fear that deleting them may cause you data loss. May be a good idea to export/dump whatever you have in the DB just in case.