วันอังคารที่ 25 มกราคม พ.ศ. 2554

Table is marked as crashed and should be repaire

MySQL อาจเกิดปัญหา ทำให้เกิด Error ทำนองนี้

"Table xxx is marked as crashed and should be repaired"

ให้ทำดังนี้

1. ไปยังพื้นที่จัดเก็บ Database File คือ /var/lib/mysql

2. แล้วเข้าไปใน Directory ของ Database นั้นๆ เช่น xxx เป็นต้น

3. ใช้คำสั่ง myisamchk xxx.MYI เพื่อตรวจสอบ (xxx คือชื่อ Database ตัวที่มีปัญหา)

4. หากพบปัญหา ลองใช้คำสั่ง myisamchk -r xxx.MYI เพื่อพยายาม recovery เป็นอันดับแรก[http://dev.mysql.com/doc/refman/5.1/en/myisamchk.html ]