1、前台app报错:

MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => INSERT INTO `ecshop`.`ecs_stats` ( ip_address, visit_times, browser, system, language, area, referer_domain, referer_path, access_url, access_time) VALUES ('113.135.118.20', '1', 'Safari 537.36', 'Windows XP', 'zh-CN,zh', 'IANA', '', '', '/index.php', '1384818765') ) [2] => Array ( [error] => Table './ecshop/ecs_stats' is marked as crashed and last (automatic?) repair failed ) [3] => Array ( [errno] => 144 ) )

2、登陆mysql查询结果:

root:bj85.4bo.cn:)[ecshop]> check table ecs_stats;
+------------------+-------+----------+-------------------------------------------------------+
| Table            | Op    | Msg_type | Msg_text                                              |
+------------------+-------+----------+-------------------------------------------------------+
| ecshop.ecs_stats | check | warning  | Table is marked as crashed and last repair failed    
| ecshop.ecs_stats | check | warning  | 1 client is using or hasn't closed the table properly | 
| ecshop.ecs_stats | check | warning  | Size of indexfile is: 4173824      Should be: 1024    
| ecshop.ecs_stats | check | error    | Record-count is not ok; is 406459   Should be: 0      
| ecshop.ecs_stats | check | warning  | Found 406459 parts                Should be: 0 parts  
| ecshop.ecs_stats | check | error    | Corrupt                                              
+------------------+-------+----------+-------------------------------------------------------+
6 rows in set (0.69 sec)


3、修复表:
(root:bj85.4bo.cn:)[ecshop]> repair table ecs_stats
    -> ;
+------------------+--------+----------+-----------------------------------------+
| Table            | Op     | Msg_type | Msg_text                                |
+------------------+--------+----------+-----------------------------------------+
| ecshop.ecs_stats | repair | warning  | Number of rows changed from 0 to 406459 | 
| ecshop.ecs_stats | repair | status   | OK                                      
+------------------+--------+----------+-----------------------------------------+
2 rows in set (2.77 sec)

(root:bj85.4bo.cn:)[ecshop]> check table ecs_stats;
+------------------+-------+----------+----------+
| Table            | Op    | Msg_type | Msg_text |
+------------------+-------+----------+----------+
| ecshop.ecs_stats | check | status   | OK      
+------------------+-------+----------+----------+
1 row in set (0.59 sec)


4、查看表结构:
(root:bj85.4bo.cn:)[ecshop]> show create table ecs_stats;
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table     | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ecs_stats | CREATE TABLE `ecs_stats` (
  `access_time` int(10) unsigned NOT NULL default '0',
  `ip_address` varchar(15) NOT NULL default '',
  `visit_times` smallint(5) unsigned NOT NULL default '1',
  `browser` varchar(60) NOT NULL default '',
  `system` varchar(20) NOT NULL default '',
  `language` varchar(20) NOT NULL default '',
  `area` varchar(30) NOT NULL default '',
  `referer_domain` varchar(100) NOT NULL default '',
  `referer_path` varchar(200) NOT NULL default '',
  `access_url` varchar(255) NOT NULL default '',
  KEY `access_time` (`access_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 | 
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

(root:bj85.4bo.cn:)[ecshop]>