Unable to backup mysql db due to error 144

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Unable to backup mysql db due to error 144

Post by WillemDH »

Hello,

Just noticed that our msql backup script (/usr/local/nagiosxi/scripts/backup_xi.sh) hasn't been running for some time. Our last backup is from 13/06. I think that was the day I had to do a mysql restore after the db had crashed because all inodes on the nagios server were used..
After trying to run the script manually, I received a
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
Error backing up MySQL database 'nagios' - check the password in this script!

So I checked the script and indeed the myslq root password was no longer correct. is it possible the mysql restore also reset the backup script?

After entering the correct password in the script, I tried to run it again. This time I got the follwoing error:
Backing up MySQL databases...
mysqldump: Got error: 144: Table './nagiosql/tbl_logbook' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES
Error backing up MySQL database 'nagiosql' - check the password in this script!

Any advice what to do to get the backup script working again? I found a thread http://support.nagios.com/forum/viewtop ... 81&p=21683 with a similar issue, but I'd rather have someone of XI support have a look at it before I do anything.
As I'm in holiday for a week from tomorrow, it would be nice to have a backup before I left... :)
Grtz
Nagios XI 5.8.1
https://outsideit.net
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Unable to backup mysql db due to error 144

Post by WillemDH »

Ok, after some research, I executed

./repairmysql.sh nagiosql tbl_logbook
DATABASE: nagiosql
TABLE: tbl_logbook
/var/lib/mysql/nagiosql /usr/local/nagiosxi/scripts
Stopping mysqld: [ OK ]
- recovering (with sort) MyISAM-table 'tbl_logbook'
Data records: 0
- Fixing index 1
Starting mysqld: [ OK ]
/usr/local/nagiosxi/scripts

And the backup script works again! I'll have to remember editing the backup scrpt if I ever have to do a mysql restore again.. :)

Greetings.
Nagios XI 5.8.1
https://outsideit.net
Locked