How do I fix the following error using trustix Linux:

Fatal error: Can't open file: 'sessions.MYI'. (errno: 145) query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = '75185a7ef66c9ff13b8d8b4f50dd7e4b' AND u.status < 3 LIMIT 0, 1 in /home/httpd/html/includes/database.mysql.inc on line 66

Comments

pnelson’s picture

Fatal error: Can't open file: 'sessions.MYI'. (errno: 145) query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = '9cfc9952904233d7b9ba8f8b98273d6e' AND u.status < 3 LIMIT 0, 1 in /home/pnelson/public_html/k12edcom/includes/database.mysql.inc on line 66

This is what I'm getting from three different drupal sites served from my host. Any clues?

qolspony’s picture

Fatal error: Table 'qolspon_bmarkf.users' doesn't exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = '27ccc4cf0dda3220ae7a00105218c1db' AND u.status < 3 LIMIT 0, 1 in /hsphere/local/home2/qolspony/brunsonmarketingforce.com/Drupa/includes/database.mysql.inc on line 66

I'm the owner of 4 domain names. They are concentrated in the areas of cultural news, adult entertainment, travel and an online community. We also moderate various forums that are geared to the above focus.

utna’s picture

my webpage went down, with no html response or timeout.

there were sever SQL process running the same query:

SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = '7bf64b151265f1453

i tried to kill them, but they persisted. Is this perhaps a cron related issue?

I deleted the database user, and recreated, and the site came back up fine.

utna’s picture

the logs function in drupal reported that the cron user had an error:

Lost connection to MySQL server during query query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 0 in

/home/... .../includes/database.mysql.inc on line 66.

rwreed’s picture

I got this answer from another thread (thanks cyberchucktx!)

Using PhpMyAdmin I rebuilt the sessions table with the following command:

REPAIR TABLE sessions QUICK;

Rebuilt the table in less than a second and all was well afterward.

Good Luck

Geoff Sobering’s picture

lycros’s picture

Thanks for the info, but does anyone know WHY this happened? I'd rather cut off why it happened in the first place than just fix it everytime it happens.

(but again... thanks for the info on how to fix it.)

snackmaster’s picture

Thank you rwreed!!!!!!!!!!! You saved me bigtime.

Now as to why this happens....
I manually ran "cron.php" via browser and all was good. I then set Cron to run cron.php once an hour through my GUI webadmin. Next time i check the site (3hrs later) it's dead. Why does this happen? did I set Cron wrong?

cron.php... Drupal comes with Search enabled by default and no explanation as to why it doesn't work. Once I track down why it doesn't work I end up taking my site offline. I would say cron/search needs a little love and care from the droopy team.

muyiwataiwo’s picture

Just to say thanks for this. You saved me big time!

But as someone asked, does anybody know why this happened to start with?

Cheers, and thanks again!

Muyiwa

resting’s picture

Worked for me. Any 1 has any idea why the table corrupted in the first place??

pensatu’s picture

Thanks that is work for me..

idrawcoolstuff’s picture

Sorry really new to database management. Where do I enter:

REPAIR TABLE sessions QUICK;

to fix?

MB

MB

idrawcoolstuff’s picture

Found my answer on another thread. More simple than I thought

MB

MB

charlener’s picture

cleared out sessions, repaired, and everything. I'm using the pubcookie module though, and ssl - could this be a factor?

Thanks,
charlene