Downes celebrate the Oktoberfest

Downes’ Pub in Thomas Street, Waterford are having their annual Oktoberfest evening for 2007 on Friday, October 12th 2007. The evening is a culmination of their month-long celebration of the official German Oktoberfest and has been an annual event in Downes since 2002.

The evening itself will feature live German beer-drinking (OOompah) music by members of the City of Waterford Brass and a wide selection of especially imported German beer.

This annual event has become more and more popular each year and I would advise you to get there early before either the band runs out of steam or pub runs out of beer. I know which one my money is on!

Dumping MySQL databases on a replication slave

I spent some time looking at the mysqldump command in detail this afternoon with a view to backing up some in-house MySQL databases which were configured in a simple replicated environment (single master, single slave). I knew that executing something like:

# mysqldump -u user --password=xxxx dbname > dumpfile.sql

on the replication slave would do most of what I needed but I wanted to be sure that I was getting a consistent backup of the data nonetheless. At first, I thought I might have to stop MySQL before and after the dump but then I recalled of course that MySQL actually needs to be running to do a dump. My Subversion hat was duly removed for the afternoon!

Then I started to think about locking and flushing databases and tables, a simple database lock/unlock (read) before/after the dump should do the trick. Fortunately, this is taken care of for me by the mysqldump utility through the --opt parameter. This parameter is a shorthand way of enabling several other options, most notably the --lock-tables option, which locks the tables in the database being dumped for the duration of the dump itself.

Interestingly though, the replication process is also suspended by mysqldump and this actually lead me to falsely believe (for a short time) that all databases had been locked instead of just the one being dumped.

So, in essence, the simple command I started out with above actually does everything I need.