Recovering MySQL Corruption in Bugzilla Database
Bugzilla is a web-based bug tracking and testing application that is used by many software development companies. It extensively various databases including MySQL for its backend support especially because both of these applications are freely available. Although this tool runs pretty fine in most cases, it can get stalled when the some of the MySQL tables get corrupt. In such cases, you are unable to perform various tasks on the database. You can use the ‘myisamchk’ command with different parameters to repair MySQL database. If it does not work, then you should use a professional MySQL recovery software to recover MySQL database.
Discussing a similar situation in Bugzilla, consider you get the following error message while generating a bugs report:
“undef error – DBD::mysql::db selectrow_array failed: Table ‘attach_data’ is
marked as crashed and should be repaired [for Statement “SELECT LENGTH(thedata)
FROM attach_data WHERE id =?”] at Bugzilla/ line 344
Bugzilla::Attachment::datasize(‘Bugzilla::Attachment=HASH(0x9df119c)’) called”
Cause:
As can be inferred from the message itself, the ‘attach_data’ table is corrupt, which is why you are getting this error message in Bugzilla.
Resolution:
To resolve this error message and repair MySQL database, you should perform the following steps:
You should find out all the corrupt tables in the MyISAM database using the following command:
# myisamchk /var/lib/mysql/bugs/*.MYI >> /tmp/myisamchk_
The /tmp/myisamchk_ file will contain the list of all the checked tables as displayed:
Checking MyISAM file: user_group_
Data records: 182 Deleted blocks: 0
– check file-size
– check record delete-chain
– check key delete-chain
– check index reference
– check data record references index: 1
Repair the table using the following command:
# myisamchk -r
You should do a check and repair using the myisamchk command as displayed:
# myisamchk –silent –force –fast –update-state /var/lib/mysql/bugs/*.MYI
The ‘myisamchk’ tool is competent enough to check and repair the MyISAM table. But some instances have been noticed where the table is not repaired using this tool. On such occasions, the most worthwhile option is to use a third-party software to perform MySQL repair. These MySQL recovery tools guarantee MySQL repair without any damage to the original tables.
One such software is Stellar Phoenix Database Recovery for MySQL, which repairs MySQL files from all instances of logical corruption. Can be used on various Windows platforms including Windows 7, Vista, Server 2003, XP, and 2000, this MySQL recovery utility recovers MySQL tables created in MySQL 3.x, 4.x, 5.x, and 6.x versions.