Page 1 of 1

MySQL Replace - oops!

Posted: Wed Jun 27, 2012 2:54 am
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.

Re: MySQL Replace - oops!

Posted: Wed Jun 27, 2012 4:29 am
by cellact
Got it fixed by restoring the DB from /store/backups/mysql/daily/nagiosql/

Thank god you enabled automatic backups by default!