Home  >  Article  >  Database  >  How to optimize and repair database tables in Mysql

How to optimize and repair database tables in Mysql

黄舟
黄舟Original
2017-08-07 14:31:101569browse

Table is marked as crashed and should be repaired How to fix the error? As an excellent open source database version, Mysql database supports large data storage. However, if there are too many operations and frequent operations on the table, there may be problems with the database table that need to be optimized and repaired. This experience will briefly demonstrate the repair method

Repair the database

1. Refer to the command format

REPAIR TABLE `table_name` to repair the table. The specific operation is as follows

How to optimize and repair database tables in Mysql

2. Optimize the database mysql table information

Refer to the following picture sample format OPTIMIZE TABLE `table_name` Optimization table

How to optimize and repair database tables in Mysql

3. The above commands are simple There are commands to repair database tables, but what if you need to repair tables in batches? You can refer to the following graphical management tools to operate

Graphical interface database tool repair

1. After connecting to the database through a graphical database management tool such as navicat for rmysql or phpmyadmin. Select the table that needs to be repaired. Or select all, select optimize table

How to optimize and repair database tables in Mysql

#2. As shown below, you will be reminded of the current database table situation. Which tables have been optimized successfully

How to optimize and repair database tables in Mysql


##3. Similarly, for frequently operated tables, database table inspection and repair operations can also be performed. The method is the same

How to optimize and repair database tables in Mysql

4. Status reminder after repair, Table is marked as crashed and should be repaired. Just ask you to repair this table

How to optimize and repair database tables in Mysql

##Notes

It is very convenient to connect mysql optimization, check and repair tables through graphical management tools. But be sure to be careful not to select Delete

The above is the detailed content of How to optimize and repair database tables in Mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn