Hello all,
So this is more of a mysql issue then a Drupal one, but here it goes anyway. Recently a website that I admin started throwing up a strange mysql error on the homepage.
Warning: mysql_query(): Unable to save result set in /usr/home/pairlvec/domains/xxxxxx/content_administration/www/prod/includes/database.mysql.inc on line 49
Fatal error: Incorrect key file for table 'r'; try to repair it query: SELECT r.rid, r.name FROM role r INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 0 in /usr/home/pairlvec/domains/xxxxxx/content_administration/www/prod/includes/database.mysql.inc on line 66
So I logged into mysql and the thing is there is no table 'r' Earlier today it was saying the same error with a table of 'ur' which also didn't exist. I've been playing around with creating these tables to see if anything changes, which doesn't help, then dropping them. Somehow the error changed from the table 'ur' to just 'r'. No idea about that one. Niether one exists.
I have tried doing -
mysql> SELECT r.rid, r.name FROM role r INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 0;
ERROR 1034 (HY000): Incorrect key file for table 'r'; try to repair it
mysql>
This is on a FreeBSD server hosted through pair.com
mysql --version
mysql Ver 14.7 Distrib 4.1.15, for unknown-freebsd4.8 (i386) using EditLine wrapper
php --version
PHP 4.3.10 (cli) (built: Jan 12 2005 13:10:04)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
I'm quite new to mysql and Drupal also and any help or info would be appreciated. I inherited this site when I took over admin here and haven't had any problems so I haven't quite bothered to learn mysql or Drupal much over the last year, now here I am stuck with our page being down for days. Any help would be appreciated, thanks!
John O
Comments
So I figured out that 'r'
So I figured out that 'r' actually refers to the table 'role', so after a quick repair of that table, all is well again. Thanks!
There's a reason I always
There's a reason I always use the AS keyword in my queries.
SELECT r.rid, r.name FROM role AS r INNER JOIN users_roles AS ur ON ur.rid = r.rid WHERE ur.uid = 0;'ur' and 'r' aren't tables themselves, they're table aliases. 'r' means 'role' and 'ur' means users_roles in that particular query. Since those tables are core Drupal tables, you're in a load of trouble if they don't exist. I don't know much about how MySQL itself does it's thing, but I do know that the query in and of itself shouldn't be causing the problems.
May your problem be easily fixed by someone with more knowledge than I.
-----
Übercart -- One cart to rule them all.