---
title: Repairing MySQL tables that will not open
description: "This should be handled on a case by case basis, but if you are using the default MySQL table type of MyISAM (which is the default storage engine unless changed or specified differently) here are a few options: 1. The…"
url: "https://getsimple.net/knowledgebase/repairing-mysql-tables-that-will-not-open/"
updated: "2021-07-12"
category: Cloud Server Management / MySQL
---

# Repairing MySQL tables that will not open

This should be handled on a case by case basis, but if you are using the default MySQL table type of MyISAM (which is the default storage engine unless changed or specified differently) here are a few options:

1. The myisamchk utility can be run from a command line to checks, repairs, or optimizes tables. It is normally run while the database is not running. For more information about [myisamchk](http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html) visit the MySQL website.
2. mysqlcheck is similar in function to myisamchk, but can be run while the database is running. For more information about
    [mysqlcheck](http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html) visit the MySQL website.
3. If you login to the database, you can also run sql commands that might fix your problem.
    Examples:
    *mysql> optimize table your-tablename;
    mysql> analyze table your-tablename;
    mysql> repair table your-tablename;*
    For more information about
    [table maintenance SQL](http://dev.mysql.com/doc/refman/5.0/en/table-maintenance-sql.html) visit the MySQL website.
4. If you are getting MySQL error numbers and are not sure what they are. From a command line you can use the perror utility to lookup errors. For more info on [perror](http://dev.mysql.com/doc/refman/5.0/en/perror.html) visit the MySQL website.
    Examples:
    *shell> perror 13 64
    Error code 13: Permission denied
    Error code 64: Machine is not on the network*
