Common problems with Mysql storage engine myisam (table corruption, inaccessible, low disk space) _mysql

Source: Internet
Author: User

This article for you to share a solution to the MySQL storage engine MyISAM common problems, for your reference, the specific content as follows

One, processing the MyISAM storage engine table damage

When using MySQL, you may experience a MyISAM storage engine table corruption. as follows:

. frm is locked and cannot be modified

Cannot find the. myi file (index file)

Unexpected end of record

File is destroyed

Error nnn from table processor

Solution 1:

Repair using the Myisamchk tool from MySQL
Open the Bin directory and you can see the tool


Commands are as follows
MYISAMCHK-R TableName
R stands for recover
Or
Myisamchk-o TableName
the-o parameter represents a more secure fix for –safe-recover

Solution 2:
Fix using the MySQL check table and repair Table command
The check table is used to check for damage to the table, and repair table is used to fix bad tables.

Second, the MyISAM table too large, unable to access the problem

First we can view the MyISAM table by Myisamchk command. As shown below, I view the admin table


Datefile length represents the current file size
keyfile length represents index file size
max datefile length represents the maximum file size
max keyfile length represents the maximum index size
You can extend the data file size by using the following command
ALTER TABLE table_name max_rows=88888888 avg_row_le=66666

Third, the data directory disk space is insufficient

1, for MyISAM storage engine

You can store the data directory and index directory on different disk space.

2, for InnoDB storage engine

For tables that innodb the storage engine, because the data files and index files are stored together. So it's impossible to separate them. When there is less disk space, you can add a new data file, which is on a disk with ample space. The concrete implementation is to add this file through Innodb_data_file_path.
Innodb_data_file_path=/home/mysql/data:10000m;/user/mysql/data:10000m:autoextend
After the parameters have been modified, the server needs to be restarted before it can take effect.

Four, install multiple MySQL on the same host

In addition to each MySQL installation directory can not be the same, but also need port and socket can not be the same.
Mysql.sock is the communication between client connection and MySQL. Socket file, only local use, remote connection through TCP/IP.

The above is the MySQL storage Engine MyISAM FAQ, thank you for your reading.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.