MySQL Forums
Forum List  »  MyISAM

Error: Incorrect key file for table try to repair it
Posted by: Doug Hockinson
Date: December 06, 2011 01:06PM

My custom PHP/MySQL content management system has been running perfectly for up to 5 years on about 80 domain names, which are hosted through a Reseller account with a well-respected cPanel / Linux based web host.

About once each year, the main table might crash on 1 of 80 sites. This is more or less expected.

Yesterday *all* sites which experienced an update to data in the main table crashed the main table and displayed "Error: Incorrect key file for table try to repair it"

Crashed tables were easily repaired using phpMyAdmin. But I had to log in individually to each hosting account in order to do this, thus hours and hours wasted.

As research progressed across many domain names, I found that when I first performed CHECK using phpMyAdmin, the main table was reported to be OK, and subsequently I entered the CMS and updated a record and the table would crash.

In other words, running CHECK failed to find imminent problems. I found this problem not only on my Reseller account, but also on 1 client hosted on a different server with the same web host.

The web host emphatically states no updates had been applied to MySQL, nor were other system modifications implemented which would have caused this.

I also have a Sunday-only cron job which runs on each hosting account. It runs a CHECK on all tables on all domains, and if problems exist then REPAIR TABLE EXTENDED is run. Over the past year there were about 12 occurrences where my cron CHECK found a problem and ran the REPAIR sequence.

It is un-nerving to think that CHECK fails to identify imminent problems.

It is un-nerving to know that nearly all of 80 businesses which I serve could have their website crash after content is updated.

The following copied from phpMyAdmin:

MySQL
-- Server: Localhost via UNIX socket
-- Server version: 5.1.56
-- Protocol version: 10
-- User: phpvs@localhost
-- MySQL charset: UTF-8 Unicode (utf8)

Web server
-- cpsrvd 11.30.5.2
-- MySQL client version: 5.1.56
-- PHP extension: mysql Documentation

Schema for the main table may differ slightly, over time, as various options were added.

--
-- Table structure for table `vs_content`
--

CREATE TABLE IF NOT EXISTS `vs_content` (
`id` smallint(5) unsigned NOT NULL DEFAULT '0',
`forum_id` tinyint(3) unsigned NOT NULL DEFAULT '1',
`posted_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`author` varchar(255) NOT NULL DEFAULT '',
`link` varchar(255) NOT NULL,
`heading` varchar(255) NOT NULL,
`meta_title` varchar(255) NOT NULL DEFAULT '',
`meta_desc` text NOT NULL,
`meta_key` text NOT NULL,
`js_inc` varchar(255) NOT NULL DEFAULT '',
`css_inc` varchar(255) NOT NULL DEFAULT '',
`php_inc` varchar(255) NOT NULL DEFAULT '',
`body_arg` varchar(255) NOT NULL DEFAULT '',
`html_1` text NOT NULL,
`html_2` text NOT NULL,
`php_script` varchar(255) NOT NULL DEFAULT '',
`content_css` varchar(255) NOT NULL DEFAULT 'class="content"',
`content` text NOT NULL,
`td_left` enum('1','0') NOT NULL DEFAULT '1',
`td_left_css` varchar(255) NOT NULL DEFAULT 'class="td-left"',
`td_left_inc` varchar(255) NOT NULL DEFAULT '',
`td_left_content` text NOT NULL,
`td_right` enum('0','1') NOT NULL DEFAULT '0',
`td_right_css` varchar(255) NOT NULL DEFAULT 'class="td-right"',
`td_right_inc` varchar(255) NOT NULL DEFAULT '',
`td_right_content` text NOT NULL,
`eval_content` enum('0','1','2') NOT NULL DEFAULT '0' COMMENT 'no, eval, highlight_string',
`thread_id` mediumint(6) NOT NULL DEFAULT '0',
`parent_id` mediumint(6) NOT NULL DEFAULT '0',
`level` mediumint(6) NOT NULL DEFAULT '0',
`thread_pos` mediumint(6) NOT NULL DEFAULT '0',
`userid` mediumint(6) NOT NULL DEFAULT '0',
`mli` enum('0','1') NOT NULL DEFAULT '0',
`ul` enum('0','1','2','3','4','5','6','7','8','9') NOT NULL DEFAULT '0',
`https` enum('0','1') NOT NULL DEFAULT '0',
`nav` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '1 stealth, 2 lightbox',
`hidden` enum('0','1') NOT NULL DEFAULT '0',
`deleted` enum('0','1') NOT NULL DEFAULT '0',
`spider` enum('1','0') NOT NULL DEFAULT '1',
`priority` enum('0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0') NOT NULL DEFAULT '0.5',
`changefreq` enum('always','daily','hourly','monthly','never','weekly','yearly') NOT NULL DEFAULT 'monthly',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `idx_id` (`id`),
KEY `idx_thread_id` (`thread_id`),
KEY `idx_thread_pos` (`thread_pos`),
KEY `idx_userid` (`userid`),
KEY `idx_forum_id` (`forum_id`),
KEY `idx_deleted` (`deleted`),
KEY `idx_hidden` (`hidden`),
KEY `idx_ul` (`ul`),
KEY `idx_mli` (`mli`),
FULLTEXT KEY `idx_search` (`heading`,`content`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Options: ReplyQuote


Subject
Views
Written By
Posted
Error: Incorrect key file for table try to repair it
14699
December 06, 2011 01:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.