4. failed to open the table: Can 'topenfile: '××. myi' (errno: 145 ).
5,
3. prevent MySQL table corruption
You can use the following methods to prevent mysql table corruption:
1. regularly use myisamchk to check the MyISAM table (note that mysqld should be disabled). We recommend that you use checktable to check the table (do not disable mysqld ).
2. after a large number of update or delete operations, OPTIMIZETABLE is recommended to optimize the table, which reduces file fragments and the probability of table corruption.
3. shut down mysqld before shutting down the server (close the service normally, do not use kill-9 to kill the process ).
4. use the ups power to avoid sudden power failure.
5. use the latest stable mysql version to reduce table corruption caused by mysql Bugs.
6. for the InnoDB engine, you can use innodb_tablespace_monitor to check the integrity of file space management in Space files.
7. perform raid on the disk to reduce disk errors and improve performance.
8. it is best for the database server to run only mysqld and other necessary services, instead of other business services, so as to reduce the possibility of table damage caused by crashes.
9. Don't be afraid of accidents. backing up tables is an effective way to prevent table damage.
4. repair of MySQL table corruption
To fix the MyISAM table, follow these steps:
1. use reapairtable or myisamchk to fix the issue.
2. if the above method does not work, use backup to restore the table.
For details, refer to the following practices:
Phase 1: Check your table
If you have a lot of time, run myisamchk *. MYI or myisamchk-e *. MYI. Use the-s (silence) option to disable unnecessary information.
If the mysqld server is down, use the -- update-state option to tell myisamchk to mark the table as 'checked '.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service