MySQL Data Recovery Post-Drop Command

July 27th, 2010

I had a brief scare today. I accidentally deleted the database for an equipment website I manage in our office (bumblebeedb). The database is running on a Mac OS X Server (10.5.8) machine that is curiously no longer completing Time Machine backups (argh). My last backup for the deleted database occurred back in 2008! Luckily, Apple has enabled mysqlbinlog on OS X Server, so all the changes that were made to “bumblebeedb”, since the last backup in 2008, were found in the following directory:

/private/var/mysql/

In this directory, there should be several file names like “mysql-bin.000040″ (sequentially increasing) that contain changes you’ve made to your MySQL databases over time.

To get all the data for my equipment website back up, I fired up “Sequel Pro.app”, imported my backup from 2008 (a .sql file), fired up Terminal, and entered:

mac022374:bschwie$ cd /private/var/mysql
mac022374:mysql bschwie$ mysqlbinlog mysql-bin.000050 mysql-bin.000051 mysql-bin.000052 mysql-bin.000053 mysql-bin.000054 mysql-bin.000055 mysql-bin.000056 mysql-bin.000057 mysql-bin.000058 mysql-bin.000059 mysql-bin.000060 mysql-bin.000061 mysql-bin.000062 mysql-bin.000063 mysql-bin.000064 mysql-bin.000065 mysql-bin.000066 mysql-bin.000067 mysql-bin.000068 mysql-bin.000069 mysql-bin.000070 mysql-bin.000071 mysql-bin.000072 mysql-bin.000073 mysql-bin.000074 mysql-bin.000075 mysql-bin.000076 mysql-bin.000077 mysql-bin.000078 mysql-bin.000079 mysql-bin.000080 mysql-bin.000081 mysql-bin.000082 mysql-bin.000083 mysql-bin.000084 mysql-bin.000085 mysql-bin.000086 mysql-bin.000087 mysql-bin.000088 mysql-bin.000089 mysql-bin.000090 mysql-bin.000091 mysql-bin.000092 mysql-bin.000093 mysql-bin.000094 mysql-bin.000095 mysql-bin.000096 mysql-bin.000097 mysql-bin.000098 mysql-bin.000099 mysql-bin.000100 mysql-bin.000101 mysql-bin.000102 mysql-bin.000103 mysql-bin.000104 mysql-bin.000105 mysql-bin.000106 mysql-bin.000107 mysql-bin.000108 mysql-bin.000109 mysql-bin.000110 mysql-bin.000111 mysql-bin.000112 mysql-bin.000113 mysql-bin.000114 mysql-bin.000115 mysql-bin.000116 mysql-bin.000117 mysql-bin.000118 mysql-bin.000119 mysql-bin.000120 mysql-bin.000121 mysql-bin.000122 mysql-bin.000123 mysql-bin.000124 mysql-bin.000125 | mysql -u root -p

where, the file names ending in .000050 through .000125 contained all the changes I needed to update my 2008 backup to the present (mid-2010).

SUCCESS!

I need to automate a script to back up the mysql database in the future. The rescue effort shouldn’t have come down to this… MySQL has published additional information that may be helpful for your own recovery attempt. Additionally, they have another reference for recovering from crashes.

VirtualBox 3.2.4 (and earlier versions)

June 24th, 2010

Had a problem with VirtualBox not launching. I fired up Console to view the console messages and found the following error message:

Cannot trust the directory “/Applications/VirtualBox.app/Contents/MacOS”.

Turned out to be a permissions issue with the root user owning a directory. I fired up Terminal.app, ran the following commands, and all was good:

sudo chmod 755 /Applications/VirtualBox.app/Contents/MacOS
sudo chmod 755 /Applications/VirtualBox.app/Contents/MacOS/components

Settings for a Windows XP client to OS X VPN Server

February 12th, 2010

If you have Mac OS X Server and are running a VPN daemon, enter the following the settings on the Windows XP client:

General Tab:
put your server’s address of resolvable name (vpn.yourserver.com)

Security Tab>Advanced>Settings…:
Require encryption ()disconnect if server declines
Microsoft CHAP Version 2 – only thing that should be checked

Security Tab:
IPSec Settings…:
Your share secret – the one you put in the Mac OS X server VPN

Networking Tab:
Choose “L2TP IPSec VPN”

Day #5 Post-op

October 14th, 2009

I booked an appointment with Meyer to see him this Friday. Maybe he’ll cut the stitches out for me, as they feel like they’re pulled on tissue beneath my skin when I do physical therapy… Speaking of which, I can bend my knee a good 90 degrees today and sometimes further. I’ve scaled back the use of the cryo-cuff, as I’m just getting tired of filling it with ice every day. Up until now, it was providing great relief. Oh yeah, maybe stopping the cryo-cuff was a little premature, as I noticed a good amount of blood/bruising on the inside of my knee and its also fairly swollen still.

Day #4 Post-op

October 13th, 2009

The pain is still a little less today, but still achy/growing pain-like feeling in and around my right knee. I’ve started to do 2 steps at a time, up with the good, down with the bad, but walking around is still one step at a time. Again, this feels slower than past surgeries, but maybe its just slipping my mind?

Day #3 Post-op

October 12th, 2009

So, the pain seems less today which is good, but now its a cross between dull aches and growing pains. Whatever, still taking ibuprofen and by the end of the day I was starting to go up stairs, one at a time :)

And the pain continues…

October 11th, 2009

Yikes, I thought the pain would be less this time, as I was getting a cadaver tendon for my new ACL, but the pain is fierce. I’ve already weaseled off my bandages and jumped in the shower this morning and it feels darn good. I’m taking baby steps, which is better than yesterday… Time to start working on ROM.

ACL #3

October 10th, 2009

Man, I seem to have quickly forgotten how painful the post-op recovery is after the block wears off. Funny, you’d think the third time around and I’d have it all memorized… As expected, the block faded away about 3 AM this morning and the pain poured on. I probably I compounded the problem as I refused to take Vicodin when I went to bed and instead I thought the nurse recommended that I take vistaril as she said it would be good for the joint. At 3 AM when I woke up, I popped a couple ibuprofen and another vistaril to alleviate the pain and now I’m reading that vistaril is only good for the post-op effects from general anesthesia. Doh! Anyway, I’ve made it this far without a narcotic, so I’m sticking with ibuprofen the rest of the way.

NiteRider Evolution Smart bulb replacement

September 21st, 2009

I’m planning to replace my the LUKS MR11C 20 degree spot 6 volt 15 watt (7 H) bulb in my discontinued NiteRider Evolution Smart with one of these bulbs. It appears the new one could be a flood bulb, but its a fraction of the price of a spot bulb, so I’m willing to roll with it and report back.  Also, I was a little confused with the entire lighting system when the bulb was dead.  The NiteRider system still flashed the the first red LED and the third overall LED (green) from the right when the bulb was dead, but none of this was documented in the manual that shipped with the system.  The previous bulb was only about a year old, so I was skeptical the bulb was in fact broken…

Add File Path Contextual Menu to Snow Leopard

September 1st, 2009

If you’re like me and need to access file paths for files and folders and prefer to do it via a contextual menu item in Mac OS X Snow Leopard, these directions and screenshots should show you the essentials to get it working:

“Services” have taken over in Snow Leopard and you have complete control of them via System Preferences->Keyboard. If you want to add a new Service to allow you to right click on a file in the Finder and place its file path to the clipboard, fire up Automator and configure it as this screen shot shows and save it as a “Service”. Here’s the code for copying and pasting into Automator:

set itemPath to “”
set uPath to “”
tell application “Finder”
activate
set itemPath to selection as string
set uPath to POSIX path of itemPath
set the clipboard to uPath
end tell

Copy Path Script for Services Menu

Code compiled correctly - see quotation marks