corrupt maillog.ibd - how do we fix them now?

Questions and answers about how to do stuff
Post Reply
Steve9R
Posts: 11
Joined: 27 Aug 2015 00:04

corrupt maillog.ibd - how do we fix them now?

Post by Steve9R »

since the latest round of updates our db's have moved from MYI's to IDB's

the procedure we used to use to repair corrupt tables was :

Code: Select all

service MailScanner stop
service mysqld stop
cd /var/lib/mysql/mailscanner
myisamchk --check *.MYI
myisamchk --recover maillog.MYI
service mysqld start
service MailScanner start
is there a new procedure for repairing corrupt tables?
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: corrupt maillog.ibd - how do we fix them now?

Post by pdwalker »

How do/did you get corrupted ibd's?

Try this command to check the tables.

Code: Select all

mysqlcheck -all-databases -o -uroot -p`grep ROOT /etc/EFA-Config | awk -F: '{print $2}'`
However, if you really have corrupted innodb files, then you'll need to do a bit more to recover. A quick search for "mariadb repair innodb" turned up this: http://stackoverflow.com/questions/2261 ... nodb-table

Read everything before taking the next steps.

Make sure you have your backup copies before attempting repair, in case you make things worse.
fencepost
Posts: 7
Joined: 11 Oct 2017 16:13

Re: corrupt maillog.ibd - how do we fix them now?

Post by fencepost »

When the DB wouldn't start for me (memory errors crashed the host), I did the following and apparently just looking at it read-only was enough to get it to start properly..... That matches up with things I'd seen elsewhere where people said just dumping the DB would resolve their issue.

create /etc/my.cnf.d/innodb_recovery.cnf (NOTE: This has the option commented out, uncomment for actual use)

Code: Select all

[mysqld]
#innodb_force_recovery=1

Code: Select all

service postfix stop
service mysqld start
The command as given above (with the needed extra - added to --all-databases)

Code: Select all

service mysqld stop
Comment out the innodb_force_recovery line before proceeding or remove that file

Code: Select all

shutdown -r now
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: corrupt maillog.ibd - how do we fix them now?

Post by shawniverson »

Yeah, the recovery in eFa does not do this on purpose, it uses only a safe recovery, because this has potential to wreck havoc. Backing up before proceeding like this is a must.
Post Reply