Flag This Hub

A small insight into index file corruption in MySQL 5.1

By


MySQL database system is truly known as the cynosure of all web developers today. It makes development so easy by allowing you to integrate with a number of programming languages and web-based technologies. Moreover, on the grounds of performance, it supersedes many other database management systems. However, MySQL databases are prone to corruption, which normally occurs in the event of a virus infection, hardware malfunction, or abnormal system shutdown. As a result, all your vital database components may become inaccessible. To overcome this problem, you need to go for MySQL recovery through a reliable third-party utility.

Suppose you have MySQL 5.1 installed in your system. You encounter a sudden power outage while working on one of your MyISAM tables. Sometime later, when you again try to access the table and add certain records, you may come across the following error message on your screen:

MySQL error code 136 = No more room in index file”

The above error may occur due to any of the following reasons:

  • The index (or .MYI) file corresponding to the specified table might have reached its upper limit and there is no space left in the file to add any more data.

  • Due to the sudden or instant power outage, the MyISAM table got damaged. As a consequence, when you try to access the table, you get the above error.

You need to take the following steps to resolve the issue:

  • Use ALTER TABLE command: If the index file is nearly full and there is no more room to insert data, you can use the 'ALTER TABLE' command to make changes to the table structure. For the same, use the following syntax:

'ALTER TABLE tbl_name MAX_ROWS=xxx AVG_ROW_LENGTH=yyy'

  • Use myisamchk utility: To resolve the problem of logical table corruption, you can use 'myisamchk' utility. This tool will help you to check your corrupt MyISAM table for errors and repair them simultaneously.

shell> myisamchk --silent --force --fast --update-state \

--key_buffer_size=64M --sort_buffer_size=64M \

--read_buffer_size=1M --write_buffer_size=1M \

/path/to/datadir/*/*.MYI

If the problem still persists, you should take help of a proficient MySQL repair utility. These third-party software encompass several user-friendly and easy-to-use options to make recovery effortless and less time-consuming. The advanced, built-in scan algorithms ensure that you get more accurate and reliable results within the least expected time. Moreover, they are compatible with Windows 7, Vista, Server 2003, XP, and 2000.

Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working