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 » 15 May 2017 22:48

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: 1137
Joined: 18 Mar 2015 09:16

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

Post by pdwalker » 16 May 2017 03:35

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: 5
Joined: 11 Oct 2017 16:13

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

Post by fencepost » 11 Oct 2017 16:29

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: 2827
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

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

Post by shawniverson » 11 Oct 2017 17:18

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.
Version eFa 4.0.0 RC3 now available in testing repo. Come join us in advancing eFa!

Post Reply