Change website

From Jan 16 2015,


All post content will be move to we's offical website with many content...

Can access website here: http://justox.com

Thanks for your visit!

Thursday, 19 December 2013

InnoDB database recovery

If mysql shutdown unexpectly, innodb might crashed and not possible to
repair through phpmyadmin or mysql konsole.
Solution:

1) check the innodb log file size
-rw-rw—- 1 mysql mysql 104857600 Oct20 17:50 ib_logfile0
-rw-rw—- 1 mysql mysql 104857600 Oct 20 17:01 ib_logfile1
So the size is 104857600
2) now edit /etc/my.cnf
add these two line on top, edit the log size according to server
innodb_force_recovery=6
innodb_log_file_size=104857600
3) restart mysql
service mysql restart
4) now dump database
mysqldump database_name > database_name.sql
5) Now exit recovery mode by removing those two line that has been added
6) restart mysql
service mysql restart
7) now drop the tables from the database, and restore it using the
.sql file that has been dumped.
that’s all

No comments:

Post a Comment