Mysql 提示错误

在登陆umail时.登陆某一个用户.有出现下面的错误提示.

Fatal error:  Uncaught exception 'PDOException' with message 
'SQLSTATE[HY000]: General error: 145 Table './umail/wm_statistics' is 
marked as crashed and should be repaired' in 
/usr/local/u-mail/data/www/webmail/admin/lib/UMail/BaseDB.php:0
Stack trace:
#0 /usr/local/u-mail/data/www/webmail/admin/lib/UMail/BaseDB.php(0): 
PDOStatement->execute()
#1 [internal function]: UMail\BaseDB->callGetone('wm_statistics', 
'mailbox_id', 'domain_id = :do...', Array, 0)
#2 /usr/local/u-mail/data/www/webmail/admin/lib/UMail/BaseDB.php(0): 
call_user_func_array(Array, Array)
#3 /usr/local/u-mail/data/www/webmail/admin/lib/Webmail.php(0): 
UMail\BaseDB->__call('getone_statisti...', Array)
#4 /usr/local/u-mail/data/www/webmail/admin/lib/Webmail.php(0): 
Webmail->getone_statistics('mailbox_id', 'domain_id = :do...', Array,
 0)
#5 /usr/local/u-mail/data/www/webmail/admin/lib/Webmail.php(0): 
Webmail->getStatisticsByID('1', '239', 'mailbox_id', 0)
#6 
/usr/local/u-mail/data/www/webmail/module/default/program/o_user.php(0):
 Webmail->setLastLoginStat('1' in /usr/local/u-mail/data/www/webmail/admin/lib/UMail/BaseDB.php on line 0

经检查,是表的问题所导致的.

查找. 需要修复下表的索引即可.既MYI文件.

最终解决办法:

[root@localhost bin]# ./myisamchk -c -r /usr/local/u-mail/data/mysql/default/umail/wm_statistics.MYI
Warning: Using unique option prefix read_buffer instead of read_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Warning: Using unique option prefix write_buffer instead of write_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
- recovering (with sort) MyISAM-table '/usr/local/u-mail/data/mysql/default/umail/wm_statistics.MYI'
Data records: 95
- Fixing index 1
[root@localhost bin]# pwd
/usr/local/u-mail/service/mysql/bin
[root@localhost bin]#

再次尝试登陆.恢复正常.


你可能感兴趣的:(Mysql 提示错误)