Results 1 to 6 of 6

Thread: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

  1. #1
    Join Date
    Mar 2009
    Posts
    92

    Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    hi,
    InnoDB tables are my favorite. Transactional, reliable and unlike MyISAM, InnoDB supports concurrent writes into the same table.Many of our InnoDB and MyISAM tables were corrupted because of this “little” mistake.MySQL database allows to define a different MySQL storage engine for different tables.so is there any simple procedure that can restore all my data (or at least most of it).

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    Execute the myisamchk software inside your MySQL data directory. If you don’t know where this directory is, check the parameter datadir on your MySQL configuration file (my.ini on Windows, my.cfg on Linux/Unix).

    You must use two parameters: –force and –verbose (which is optional) like bellow:

    myisamchk --force --verbose */*.MYI

    The –force parameter will instruct myisamchk to repair automatically every problem it may encounter on your MyISAM tables, while the –verbose (which is optional) will only show the status of execution of the myisamchk program on your screen.Start the MySQL server with the parameter –innodb_force_recovery Try to start your MySQL server with this parameter. The value must be a number between 1 and 6. As higher it’s value, worst are the problems on your MySQL tablespace.If you only got to start your MySQL server with a value bigger than four, your databases will be in read only mode. If not, your users may use the server normally.

    If you wish, you may also add the command innodb_force_recovery to your MySQL configuration file as in the example bellow:

    [mysqld]
    innodb_force_recovery=4

    After your MySQL server starts, backup your data and then restore them on a new MySQL installation.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    You can check the health of a MyISAM table using the CHECK TABLE statement, and repair a corrupted MyISAM table with REPAIR TABLE. When mysqld is not running, you can also check or repair a table with the myisamchk command.

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    Execute the myisamchk as shown below, with -r option to repair the corrupted tables.
    Code:
    # myisamchk -r profiles.MYI
    
    - recovering (with sort) MyISAM-table ‘profiles.MYI’
    Data records: 80
    - Fixing index 1
    - Fixing index 2
    You may get error message: clients are using or haven’t closed the table properly, if the tables are still getting used by your application and other tables. To avoid this error message, shutdown mysqld before performing the repair, if you can afford to shutdown the DB for a while. If not, use FLUSH TABLES to force mysqld to flush any table modification that are still in memory.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    Bad memory or MySQL Bugs on Primary can corrupt storage… which will be replicated by DRBD - Long switch time even for Innodb tables - on large system tuned for … may take infinity to check and repair - Waste of hardware as Secondary node …

  6. #6
    Join Date
    May 2008
    Posts
    2,297

    Re: Restore corrupted MyISAM/InnoDB tables on MySQL 5.0

    Stellar Phoenix Database Recovery for MySQL is an advanced and easy to use repair application, which repairs and restores corrupted MySQL database. It supports in depth recovery from both MySQL database storage engines - MyISAM and InnoDB. As the most dynamic MySQL recovery utility, it supports recovery of lost or corrupted MySQL databases created on both Windows and Linux platforms.

    Download Stellar Phoenix Database Recovery for MySQL

Similar Threads

  1. How to manage databases and tables in MySQL?
    By Aahlaadith in forum Software Development
    Replies: 5
    Last Post: 17-12-2010, 07:18 AM
  2. How to create MySQL Database and Tables in PHP?
    By Orton in forum Software Development
    Replies: 4
    Last Post: 23-02-2010, 06:45 AM
  3. Mysql select from multiple tables for php.
    By afidelino in forum Software Development
    Replies: 4
    Last Post: 09-07-2009, 06:13 PM
  4. MySQL MyISAM vs InnoDB
    By tombman in forum Software Development
    Replies: 5
    Last Post: 13-04-2009, 03:42 PM
  5. MyISAM Static Vs MyISAM Dynamic
    By Sylvester.S in forum Education Career and Job Discussions
    Replies: 2
    Last Post: 24-10-2008, 07:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,996,242.81629 seconds with 17 queries