Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Sorry about that here is some more info:
You should include:
a- The version of Zen Cart you are using and whether this is a new install or an upgrade.
I think im on version 1.3.7, new install
b- A list of all the addons/contributions you have installed, and any kinds of customizations you've made to your site.
Cart Editor nothing else
c- The type of server you are using and, if you are installing locally, the operating system
This i dont know, i do know my site is hosted in Florida on Linux server
d- The version of PHP installed on the server
phpMyAdmin - 2.8.2.4
e- The version of MYSQL installed on the server
MySQL - 4.1.20
f- Details of exactly what you were doing when your problem occurred.
I logged into the site and found the error
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Here is a link to a screenshot of the admin_activity_log
http://img262.imageshack.us/img262/1...vityloggj1.jpg
Does any thing look odd?
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
[FONT=Arial]Hi All again[/FONT]
[FONT=Arial]I have PMed DrByte for some help but will post my PM here as well, maybe some one can see something i dont as im new to MySQL and have no idea what im looking for:[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]Please see below for things I have found that look a bit odd while checking each tables “Auto_Increment” is on and that the Next Autoindex number is correct when checking against the primary field under the browse option for that table :[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]email_archive table - not found in mysql[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]featured table shows value 11 for Next Autoindex but the browse option is greyed out[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]products_attributes table shows value 1,104 for Next Autoindex but browse button greyed out[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]specials table shows value 51 for the Next Autoindex but browse button greyed out[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]banners table shows value 56 for the Next Autoindex but browse button greyed out[/FONT]
[FONT=Arial]· [/FONT][FONT=Arial]configuration table shows the following warning UNIQUE and INDEX keys should not both be set for column `configuration_key`[/FONT]
[FONT=Arial]PS – I have also checked the updated SQL script in the Zen Cart 1.3.8 zip files[/FONT]
[FONT=Arial]Some other details:[/FONT]
[FONT=Arial]Site: http://www.digitalsaonline.co.za/catalog/[/FONT]
[FONT=Arial]MySQL - 4.1.20[/FONT]
[FONT=Arial]phpMyAdmin - 2.8.2.4[/FONT]
[FONT=Arial]Error occurred on the: 28th June 2008[/FONT]
[FONT=Arial]System Changes: none what so every prior to error, apart from new banners:[/FONT]
[FONT=Arial]Other errors:[/FONT]
[FONT=Arial]Site:[/FONT]
[FONT=Arial]1062 Duplicate entry '0' for key 1
in:
[insert into banners_history (banners_id, banners_shown, banners_history_date) values ('55', 1, now())][/FONT]
[FONT=Arial]Admin:[/FONT]
[FONT=Arial]1062 Duplicate entry '0' for key 1
in:
[insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '1', 'store_manager.php', '', '198.54.202.30')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.[/FONT]
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Quote:
Originally Posted by
LloydR
Yes ... why is the table empty (0 rows) and created today?
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Quote:
Originally Posted by
LloydR
Please see below for things I have found that look a bit odd while checking each tables “Auto_Increment” is on and that the Next Autoindex number is correct when checking against the primary field under the browse option for that table :
· featured table shows value 11 for Next Autoindex but the browse option is greyed out
· products_attributes table shows value 1,104 for Next Autoindex but browse button greyed out
· specials table shows value 51 for the Next Autoindex but browse button greyed out
· banners table shows value 56 for the Next Autoindex but browse button greyed out
If the browse button is greyed out, that means there's no data in the table to be browsed
Quote:
Originally Posted by
LloydR
· email_archive table - not found in mysql
If you're not archiving any emails then that won't matter. But it begs the question of "how" did it disappear? If it's missing during a database-upgrade, you may run into errors that will cause upgrade challenges since it will have to abort mid-stream. Thus I suggest that you recreate it perhaps from a backup.
Quote:
Originally Posted by
LloydR
· configuration table shows the following warning UNIQUE and INDEX keys should not both be set for column `configuration_key`
That's normal, and can be ignored.
Quote:
Originally Posted by
LloydR
1062 Duplicate entry '0' for key 1
in:
[insert into banners_history (banners_id, banners_shown, banners_history_date) values ('55', 1, now())]
"key 1" is probably the primary key on the table, which would be the banners_history_id field.
Since the "insert" statement doesn't mention that field (and this is normal and desired), it is expecting the auto-increment attribute of that field to automatically select the correct next number. So, if you're getting that error on that table, it means the banners_history_id is not set to autoincrement.
Quote:
Originally Posted by
LloydR
Admin:
1062 Duplicate entry '0' for key 1
in:
[insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '1', 'store_manager.php', '', '198.54.202.30')]
Same issue as mentioned above for banners_history table.
If it was working flawlessly until a certain date, then unless it's something you or your staff have done to the site, your first line of support for these odd database issues should be your hosting company -- so they can investigate what may be wrong on the server to break the autoincrement funcitonality.
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Quote:
Originally Posted by
DrByte
Yes ... why is the table empty (0 rows) and created today?
I clicked on empty, could that be the issue?
Thanks for the reply
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
Great my hosting company changed servers with our telling me, how nice of them
So i worked in the wrong DB the whole week end
Thanks for the help DrByte
Re: 1062 Duplicate entry '0' for key 1 after export/import of database
The problem for me was that there were still entries for old customers sitting in the "customer_info" table. I dropped that and started my 'customers_id' field in the "customers" table at 1 again and it works great. Hope this helps someone.