MyBB Community Forums

Full Version: session error with mysql
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello community.

Please see the attachment. Today morning, suddenly I started getting this error, while trying to open the page. The error shows

SQL Error:
1062 - Duplicate entry '0' for key 2
Query:
REPLACE INTO mybb_sessions SET uid='0',sid='03c3ba74776859a1691eee87cbb23ac2',time='1322024288',ip='116.203.213.9',location='/index.php?',useragent='Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari',location1='0',location2='0',nopermission='0'


I cleared the cache of the browser and could not remove the problem. Should I delete all entries from mybb_sessions with uid='0'?


[attachment=24732]
Try doing a db repair. Go to your PHPMYADMIN and select your database and go to SQL tab and run below query and see if it fixes:

REPAIR TABLE `mybb_sessions`
(2011-11-23, 05:11 AM)crazy4cs Wrote: [ -> ]Try doing a db repair. Go to your PHPMYADMIN and select your database and go to SQL tab and run below query and see if it fixes:

REPAIR TABLE `mybb_sessions`

Wow that works. Thanks. The session table was crashed, and it is working fine now.

But here is some kind of error with mybb. suppose we are using wireless broadband , IP is allocated dynamically. It may happen that the address that we last logged in with might be changed during next login. Will the table be crashed every time that happens?
No problem, whenever you face such errors, the very first thing you should do is try repairing them and see if it fixes. Sessions table keep on crashing frequently, nothing to worry about.


(2011-11-23, 05:23 AM)rupam das Wrote: [ -> ]But here is some kind of error with mybb. suppose we are using wireless broadband , IP is allocated dynamically. It may happen that the address that we last logged in with might be changed during next login. Will the table be crashed every time that happens?
No, don't worry, dynamic IP has nothing to do with it. The query shows the user's IP for which this crash is happening, it doesn't happen every time, as mentioned above.
Hello Guys. With your help I have been able to resolve this issue but there is something quite critical. Every alternative day mybb_sessions table is getting crashed and I need to restore it. Well, it is not possible to be logged into the site every day, every moment. So kindly suggest me if I could solve this issue in any other ways.
hi I restart the machine after a workout in this issue

how to fix it once did. what is the cause of the error
Run the following query in phpmyadmin and it'll prevent the table from crashing:

alter table mybb_sessions engine=memory;