How do I repair an InnoDB table?

后端 未结 7 1079
迷失自我
迷失自我 2020-11-30 02:52

We (apparently) had poorly executed of our Solaris MySQL database engine last night. At least some of the InnoDB tables are corrupted, with timestamp out of order errors in

7条回答
  •  攒了一身酷
    2020-11-30 03:52

    Step 1.

    Stop MySQL server

    Step 2.

    add this line to my.cnf ( In windows it is called my.ini )

    set-variable=innodb_force_recovery=6
    

    Step 3.

    delete ib_logfile0 and ib_logfile1

    Step 4.

    Start MySQL server

    Step 5.

    Run this command:

    mysqlcheck --database db_name table_name -uroot -p
    

    After you have successfully fixed the crashed innodb table, don't forget to remove #set-variable=innodb_force_recovery=6 from my.cnf and then restart MySQL server again.

提交回复
热议问题