How do i correct the duplicate entry error in Drupal

My website that uses drupal has been down since yesterday and all it displays is this error:

Fatal error: Duplicate entry 'b7c59e0ea3545b9b42b8372e87cee12e' for key 1 query: INSERT INTO sessions (sid, uid, hostname, timestamp) VALUES ('b7c59e0ea3545b9b42b8372e87cee12e', 0, '212.3.247.30', 1225948156) in /var/www/ffa/includes/database.mysql.inc on line 66

I have repaired and emptied the session tables but it is still not working. I also tried increasing the node id in the sequence table but still it is not working..

Can any one be of help?

Thanks
tdopsdarockAsked:
Who is Participating?
 
tdopsdarockConnect With a Mentor Author Commented:
Just found the solution at http://drupal.org/node/21120
I guess the default userid was deleted to correct use just run the SQL query
INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
INSERT INTO users_roles (uid, rid) VALUES (0, 1);

Open in new window

0
 
HuyBDCommented:
try this
REPLACE INTO sessions (sid, uid, hostname, timestamp) VALUES ('b7c59e0ea3545b9b42b8372e87cee12e', 0, '212.3.247.30', 1225948156)

Open in new window

0
 
tdopsdarockAuthor Commented:
should i add the line to the database.mysql.inc file? or run it as a mysql query?
0
 
HuyBDCommented:
you can run the query, it inserts if the key doesn't exist
0
 
tdopsdarockAuthor Commented:
This did not seem to work..Any other suggestions?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.