日期:2014-05-16  浏览次数:20783 次

bugfree中的MYSQL数据库报错,请大侠救急。
BUGFREE出现问题,报的错误内容:
ERROR OCCUR TO /BugList.php:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

The FULL SQL IS:
SELECT BugID,BugStatus,BugID,BugSeverity,BugTitle,BugStatus,OpenedBy,AssignedTo,ResolvedBy,Resolution FROM bugfree_BugInfo WHERE ProjectID IN ('9','1','2','3','5','6','7','8','10','11','12','13','15','16','17','19','20','21','22','24','25','26','27','28','29','30','31','32','33','34','35') AND 1 AND IsDroped = '0' ORDER BY BugID DESC LIMIT 0,

ERROR OCCUR TO /UserControl.php:
Table '.\bugfree\bugfree_buginfo' is marked as crashed and should be repaired

The FULL SQL IS:
SELECT BugID,BugTitle FROM bugfree_BugInfo WHERE OpenedBy = 'admin' AND BugStatus <> 'Closed' ORDER BY BugID DESC LIMIT 10

------解决方案--------------------


数据备份

1. 直接复制所有DATADIR下的文件
2. mysqldump -uroot mydb >xx.sql 导出

导入呢?
mysql -uroot < xx.sql


参见以下官方文档

8.8. mysqldump:数据库备份程序
http://dev.mysql.com/doc/refman/5.1/zh/client-side-scripts.html#mysqldump

5.9. 备份与恢复
http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#disaster-prevention
5.9.1. 数据库备份
5.9.2. 示例用备份与恢复策略
5.9.3. 自动恢复
5.9.4. 表维护和崩溃恢复
5.9.5. myisamchk:MyISAM表维护实用工具
5.9.6. 建立表维护计划
5.9.7. 获取关于表的信息