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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
tdopsdarockAuthor 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.