Pages

Repairing a Corrupted Table In Mysql


Repairing a Corrupted Table In Mysql


A Table name aggregator_item.MYI  got corrupted in database name rnmbase. we will now repair the Table so that replication work fine.



ERROR: - reports error in replication: Error 'Incorrect key file for table './rnmbase/aggregator_item.MYI'; try to repair it' on query. Default database: 'rnmbase'.

Solution:-

Stop mysql instance where the replication error came


# service mysqld  stop


To check the error

# myisamchk  /var/lib/mysql/rnmbase/aggregator_item.MYI

To fix the error

# myisamchk  -r /var/lib/mysql/rnmbase/aggregator_item.MYI

To check the error

# myisamchk  /var/lib/mysql/rnmbase/aggregator_item.MYI

Start mysql

# service mysqld start

Go to mysql prompt check the slave is running or not if not running start the slave

# mysql

Mysql>  show slave status\G

Mysql> start slave;

Mysql>  show slave status\G

Mysql> quite;


Note:- rep_mon should be installed......
# rep_mon     -------> to check replication status

4 comments:

Note:- Comment as: Option available to post without login select "Anonymous" from the drop down...........