Board logo

subject: Problem In Accessing Table With Utf-8 Data In Mysql [print this page]


MySQL version 4.1 introduced two new character sets for storing Unicode data: UCS-2 and UTF-8. Among them, UTF-8 is the one that uses one to three bytes per character and extends US-ASCII. Tables using UTF-8 data often become inaccessible or unreadable. This generally occurs when MySQL engine cannot access them, most likely when the table in issue is corrupted. The further article describes few such scenarios when a MySQL database table containing UTF-8 data can get corrupted and the possible solutions to Repair MySQL Database data from such corrupted tables.

As one of the realistic problems, a MySQL user might experience UTF-8 table corruption when he/she performs one of the following practices:

He/she change the existing structure of database table

He/she change 'ft_min_word_len' and then rebuild the database indexes

He/she run UPDATE LOW_PRIORITY command

After any of the above operations is done, MySQL user observes that the specific table cannot be accessed. On each attempt of opening the table, it returns the following or similar error message on screen:

Incorrect key file for table: 'Table_Name'; try to repair it.

Where, 'Table_Name' must be replaced by the exact name of affected database table.

Note: These problems have specifically been defined for database stored on MyISAM storage engine and not for InnoDB.

Resolution

Since the database table is corrupted, you need to following below mentioned sequence of steps to repair it:

To check if database table is actually corrupted, you should run the below command

CHECK TABLE TABLE_NAME

Where, TABLE_NAME must be replaced by the name of table in issue.

If the table is reported as corrupted, you need to run the below command to repair it:

REPAIR TABLE TABLE_NAME

In some situations, table corruption can be too extensive and cannot be fixed by MySQL built-in solutions. To repair it, you need to take aid of a third-party MySQL Repair solution. These utilities are exclusively built for repairing corrupted MySQL database components and to Recover MySQL in intact form.

MySQL is a high-end utility that uses intensive scanning methods to repair and restore corrupted MySQL database created with MyISAM and InnoDB database engines. This MySQL Recovery solution supports MySQL 4.x and MySQL 5.x and can restore all database components like, tables, views, and more.

by: Naveen Kadian




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0