1062 Duplicate entry '0' for key 1 after export/import of database
Can someone please help I am having some major problems I changed servers a few days ago at first I got this error in the admin section I found a fix on the forum and it worked.
A couple of days ago this error started to happen on the front page all content disappears and just underneath the side boxes on the left and the side boxes on the right completely disappear.
If I upload the old database from the backup I made before I moved servers it is fine at first but then the day after this problem is back again.
I really need some help on this I have to get this sit backup and running I would appreciate any help that can be given.
Re: 1062 Duplicate entry '0' for key 1
I have managed to resolve this now from what I can gather the problem was coming from anything to do with history stored in the MySql database.
If anyone else gets this problem drop everything from the following tables:
- admin_activity_log
- banners_history
- counter_history
- sessions
This should sort your problem out.
Re: 1062 Duplicate entry '0' for key 1
Hello i to have this problem i am using secpay for payment the first order i ever tested on the site worked then the second one didnt giving me a '1062 Duplicate entry '0' for key 1' on a blank page, so i deleted my first order in admin and the next order worked but the same fault again with the second test, it looks like the orders are not counting up please can some one point me in the right direction thank you.:smile:
Re: 1062 Duplicate entry '0' for key 1
this problem has come back again please help.
Re: 1062 Duplicate entry '0' for key 1
Re: 1062 Duplicate entry '0' for key 1
I am having a similar problem. I can tell you that I have moved my entire site recently from a Shared Hosting server to another shared server. The only difference between the two MySQL setup's is version numbers. I exported from the old to the new and everything took until I ran the program. I get this :
http://savannahspasecrets.com (see all the way bottom left column).
If I remove the most recent row written the app does fine until the next row... which of course is already there. It's like the app has reset the count or lost what the last ID it was on?
The app, whether logged in as admin or visitor, writes starting from '0' to each table??
Re: 1062 Duplicate entry '0' for key 1
Please someone must no what is causing this and how to fix it any help will be much appreciated
Re: 1062 Duplicate entry '0' for key 1
There are approx 100 tables in a Zen Cart database. Thus, the cause of that error could be related to any one of them.
I tried to help earlier by asking:
Quote:
Originally Posted by DrByte
What's your URL?
... but you never replied.
Re: 1062 Duplicate entry '0' for key 1
Quote:
Originally Posted by adanker
I don't see any errors on that page.
Re: 1062 Duplicate entry '0' for key 1
Code:
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', 'attributes_controller.php', '', '**.**.0.64')]
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.
Thats the error i get.
I assume this is because the Now() function is returning 0 and not the correct date & time...
Any suggestions on how to fix it?
Btw, this happens only when using the admin interface...
i'll try using the fix_cache_key, maybe that is the problem...
have to wait to ftp it up though.
Just tried fix_cache_key... doesn't help solve problem.