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.