copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2024-07-17 |
repair mysql table |
database-tools |
{{site.data.keyword.attribute-definition-list}}
{: #dbt-repair-mysql-table}
{{site.data.keyword.mysql}} table repair is handled on a case-by-case basis. If you are using the default {{site.data.keyword.mysql}} table type of MyISAM (which is the default storage engine unless changed or specified differently), you have the following options:
-
You can run the myisamchk utility from a command line to check, repair, or optimize tables. Run this command while the database is not running.
-
The mysqlcheck command is similar in function to myisamchk, but it can be run while the database is running.
-
If you log in to the database, you can also run SQL commands that might fix your problem.
*mysql> optimize table
your-tablename
*mysql> analyze tableyour-tablename
*mysql> repair tableyour-tablename
-
If you are getting {{site.data.keyword.mysql}} error numbers and you are not sure what they are, you can run the perror utility to look up errors from the command line. For more information, see MySQL documentation{: external}.
*shell> perror 13 64 *Error code 13: Permission denied *Error code 64: Machine is not on the network