The site suddenly appears with the following error:
MySQL Error: Duplicate entry ' 1 ' for key ' views '
MySQL Errno: 1062
Message: Duplicate entry ' 1 ' for key ' views '
I use
Myisamchk Cdb_posts.myi-r
Fixed the table, but the contents of the table views were emptied, fortunately, my side is the article Access scale, not very important, before also made a backup!
The following two repair tables are recommended:
REPAIR table ' table_name ' repair form
OPTIMIZE table ' table_name ' optimization tables
In most cases, you can also use the command OPTIMIZE tables to optimize and fix the table, if it is not the case or less with myisamchk, although myisamchk fast or reliable (in the case of a real fatal error).
Mainly optimize table is easier to use and you do not have to care about emptying the table.
If you delete most of a table or if you change a table with a variable length (a table with a varchar, blob, or text column), you should use Optimze table. Deleted records are maintained in a linked table and subsequent insert operations use the old record location again. You can use optimize table to reclaim unused space.
OPTIMIZE table works by making a temporary copy of the original table. The old table is copied to the new table (no idle rows), then the original table is deleted and a new one is renamed. Doing so makes all updates automatically turn to the new table without any failed updates. When optimize table is executing, the original table can be read by another customer. Updates and writes to the table are deferred until the new table is ready.
MySQL errno:1062 Bug fix