Unexpected mysql error on two sites.
Permalink
My two sites (located on one hosting) have stopped working - I get this message:
An unexpected error occurred.
mysql error: [1062: Duplicate entry '31663' for key 1] in EXECUTE("insert into PageStatistics (cID, uID, date) values ('1', 0, NOW())")
Me and site owner haven't done anything... What can be a possible reason? How to treat that?
(only one working page is login page in /index.php/dashboard, but I can't log in, and site /index.php/login is not working)
Any help would be appriciated
An unexpected error occurred.
mysql error: [1062: Duplicate entry '31663' for key 1] in EXECUTE("insert into PageStatistics (cID, uID, date) values ('1', 0, NOW())")
Me and site owner haven't done anything... What can be a possible reason? How to treat that?
(only one working page is login page in /index.php/dashboard, but I can't log in, and site /index.php/login is not working)
Any help would be appriciated
Thanks for feedback. We just cured the root, so I'll not truncate that table, but good to know, that there is that possibility.
The problem appeared just by it own - nothing was done, and that was most strange thing in that story... The other thing - the error was in 31663 entry, but there was only 31662 entries in database, so error appeared to be in non existing entry. :) What we have done was changing index (pstID) type lengh from (bigint) 20 to 32 - and thats it, problem solved :D. Now the question is if it is kind of bug in c5 DB structure, or something else - I have no idea. I'm not good at mySQL, so I needed help, but fortunately I found it locally.
BTW - it is 5.5.1
The problem appeared just by it own - nothing was done, and that was most strange thing in that story... The other thing - the error was in 31663 entry, but there was only 31662 entries in database, so error appeared to be in non existing entry. :) What we have done was changing index (pstID) type lengh from (bigint) 20 to 32 - and thats it, problem solved :D. Now the question is if it is kind of bug in c5 DB structure, or something else - I have no idea. I'm not good at mySQL, so I needed help, but fortunately I found it locally.
BTW - it is 5.5.1
Are there any updates or other changes you have recently made?
However, unless you have any analysis addons installed that use the Page Statistics table to analyse the site, the Page Statistics table is not essential to operation of the site and can be truncated using phpMyAdmin.
You can then disable page statistics in the dashboard.
This is a bit of a hack as it would be curing the symptom rather than the root cause of the problem.
Please make a full database backup using phpMyAdmin before truncating the table.