MySQL Replace - oops!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cellact
Posts: 69
Joined: Mon May 14, 2012 7:00 am

MySQL Replace - oops!

Post by cellact »

I think I did something stupid.

I ran:

mysql> update tbl_service set config_name = replace (service_description,'Abcd','Efgh');

and it affected 100+ rows... although I had only one service with a service_description matching 'Abcd'.
It seems like it duplicated a lot of services in the DB (I see many 'Sync Missed' on Nagios)

I still haven't applied configuration.
Can I roll back somehow?

Thanks.
cellact
Posts: 69
Joined: Mon May 14, 2012 7:00 am

Re: MySQL Replace - oops!

Post by cellact »

Got it fixed by restoring the DB from /store/backups/mysql/daily/nagiosql/

Thank god you enabled automatic backups by default!
Locked