« A Polyglot in the making | Main | XP Trophy Books »

April 06, 2004

DTSTTCPW

This'll be a short one I promise!

I just wanted to take a second to give a big thumbs up to the good people behind MySQL, a database I've been using in spurts for quite a while, but have only started to look into in any detail recently.

Anyways. the reason behind my rhapsody is that today I had an urgent need to get a copy of a MySQL database sitting on server A onto server B (my laptop). Specifically, I was demonstrating a piece of software that plugged into MySQL and server A held a suitably large chunk of data on it that would make good demo fodder and it made me all green with envy and "it will be mine" of thinking.

As soon as I'd considered this option, I was immediately drenched in a cold sweat as database migration is not something I'd ever really excelled at, much like Olympic-level gymnastics, chess or Lisp. I did have a lot of experience carting Oracle tables around, but remembering the pain I endured prior to first possessing that particular kitbag of skills did nothing to ease my state of mind.

So I did what any self-respecting geek would do in a similar situation: I Googled for export mysql data. The Google gods immediately rewarded me with 136,000 results and the first page contained links to several tools proclaiming MySQL export capabilities. It's downloadin' time!, thinks I.

At this point in the story I should mention that my client's internet connection is only marginally more efficient than having someone dictate the content you want over the phone and transcribing it into a file at your end. A quick check of download speeds confirmed my belief that no warping of the space-time continuum would result in me getting my chosen tool before my deadline. Time to rethink...

Folornly scanning down page 1 of my search results, I came across a link to a mailing list archive from the good people at the Nashville Linux Users Group where someone had posted a question containing requirements very similar to mine. Amidst the responses was this little speck of gold:

If all your tables are in the myisam format, you can just tar.gz the entire
data directory and copy it to the other server... 

And it's that simple: to migrate a MySQL database from one installation to another, simply scoop up the directory containing the database into your hot little hands, walk from source to destination and dump the directory into the same location... WOOT!

Obviously this has completely blatted whatever data I previously had in any equivalently named databases on my laptop, but I didn't care.

Crude? Yes
Inefficient? Probably
Overkill? Almost definitely

But it worked quickly and simply and fitted my needs perfectly. The solution was generic in a way I rarely come across in software these days: no proprietary tools, protocols or commands - just file system manipulation. Kisses and hugs to all those good Christian MySQL developers!

Posted by Andy Marks at April 6, 2004 07:27 PM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?