Database bullet dodging and lessons learned

I dodged a very large (metaphorical) bullet yesterday. I’m not in the habit of trying to find bullets to dodge, but this one found me because it tuns out I didn’t plan as well as I thought I had.

It all started yesterday morning when a client asked me to make some batch updates to the data in his MySQL database. So, I wrote a script to make the required updates. Before running the script, I made a backup of the database in case something went wrong. Everything was good so far. I ran the script, checked the database to see if anything looked amiss and called it a night (oh yeah, this was like 11:00pm last night). This morning, I get an urgent text message from the client saying that the data didn’t look quite right. No problem I think, I made a backup copy of the database last night, I can fix this. But nooooo, that database backup wasn’t around any more. Why, you ask? Oh yeah, that. I saved it to the same location that the regular, nightly backup saves to. So by the time I needed the backup this morning, it was already gone. Luckily, the eventual fix was very simple once I figured out where my script had gone wrong. It could have been really ugly though.

Read More

Start/Stop MySQL from a terminal session on OS X

This is a quick post as much to remind myself the next time I need it as anything about how to start and stop MySQL from a terminal window on OS X.

Start:

sudo /usr/local/mysql/support-files/mysql.server start

Stop:

sudo /usr/local/mysql/support-files/mysql.server stop

Stuck in D.C.

Thanks to a late afternoon winter storm yesterday, I am spending the weekend in Chantilly, VA. I was due to go home yesterday (and really looking forward to it too!) but the storm cancelled most of the flights out of Dulles and I was told they couldn’t get me back to Nashville until Sunday. Since I had to be back up here Monday, it didn’t make sense to do that, so I’m just not going home this weekend.

Verity woes this week

I’ve been in Charlotte, NC this week for my “day” job and have been working on a side project from the hotel that involves converting a large amount of data from a, let’s just say, “non-standard” database program to MySQL. One of the tables stores information about 14,000+ legal documents that we have in PDF format on the filesystem.