The theory of Shenma is full of clouds. The most practical example is:
Today, I found that the website data was abnormal. I checked the database and encountered the following error when operating a table (tbl_test:
Table '. \ mydb \ tbl_test' is marked as crashed and shoshould be retried red
You can use phpMyAdmin to fix the problem!
Use the myisamchk that comes with MySQL as follows:
Locate the location of the error table (Mysql Data in Linux is usually stored in/var/lib/MySQL)
Shell> Cd/var/lib/MySQL/mydb;
Shell> myisamchk-r Q tbl_test)
If the previous step fails, execute the next step.
Shell> myisamchk-r tbl_test; (inconsistent data and indexes are deleted and re-built)
If it fails again, execute the next step.
Shell> myisamchk -- safe-Recover tbl_test;
Note:Before using myisamchk, make sure that mysqld is not accessing the table to be checked. It is best to stop mysqld.