Deploy Zen database to report error
A fault description
Unable to login page after deploying zen path. There are the following error messages:
60507 17:03:49 [ERROR] /opt/zbox/run/mysql/mysqld: Table './ zentao/zt_group' is marked as crashed and last (automatic?) repair failed
Zen all database tables are using MyISAM storage engine, and MyISAM storage engine can easily lead to database table crash.
2 Solutions
Stop mysql and check the database file zt_group.MYI for the zt_group table using myisamchk
myisamchk is a MyISAM storage engine check and repair tool that comes with mysql.
# myisamchk zt_group.MYIChecking MyISAM file: zt_group.MYIData records: 11 Deleted blocks: 0myisamchk: warning: Table is marked as crashed and last repair failed- check file-sizemyisamchk: warning: Size of datafile is: 416 Should be: 380- check record delete-chain- check key delete-chain- check index reference- check data record references index: 1- check record linksmyisamchk: error: Keypointers and record positions doesn't matchmyisamchk: warning: Found 13 key parts. Should be: 11MyISAM-table 'zt_group.MYI' is corruptedFix it using switch "-r" or "-o"# myisamchk -r -o -f zt_group.MYI- recovering (with keycache) MyISAM-table 'zt_group.MYI'Data records: 11
Restart mysql and you can log in to zen path.
References:
http://www.thinkphp.cn/code/430.html