Sunday, 27 February 2011

How to Reclaim Disk Space After Deleting Lots of MySQL Records

Turns out MySQL’s InnoDB engine isn’t (by default) very enthusiastic to give back disk space if after mass deletions (say, a DELETE * or a TRUNCATE TABLE).

The fix is a little unsettling, but it’s also simple (and with a modestly size db – fast).

  1. Back up the db (you should doing this anyway, but now is a nice time to do it again.)
    mysqldump -uroot -p --opt --skip-lock-tables -f --quote-names --databases yourDB > yourDB.sql
  2. Confirm you made a backup. Then drop the databases you just backed up (I told you there was an un-nerving part).
  3. Shutdown the MySQL server – whatever your preferred method is. I like to click ‘stop’ in Webmin, maybe you like the command line.
  4. Remove all innodb files (it’s pretty obvious which ones they are)
  5. Restart the MySQL server
  6. Reimport your database
    mysql -uroot -p < yourDB.sql

While you’re here – hop over to my.cnf and add innodb_file_per_table so next time OPTIMIZE TABLE will actually do what you expect it to do.

Friday, 25 February 2011

More Joy

Today’s meeting free. I’ve blocked off the entire day to work on 1 thing. A little voice told me to hit play on my All Too Much Joy playlist. Perfect.

If I hit the milestone early, I think I’ll pull UHF off the Netflix.

My favorite lyric from today’s TMJ all discography listening session comes from “You Can’t Die from a Broken Heart” off the “The Its” album.

“You might even forgive me some day / But some day’s too far away / To hold us together today”

Wednesday, 23 February 2011

Safe Driving

Oh sure – I’ve 3 Large Strongspaces backing up all my websites and working files nightly. I’ve also got a 2TB Western Digital drive pulling nightly backups from all the computers in the house. Plus, a couple portable drives for the road.

To that mix, I’ve added a SentrySafe Fire-Safe Waterproof Data Storage Chest with a 1TB Western Digital portable drive.

The interior of the SentrySafe is about 5″ square – perfect size for the Western Digital drive. Actually – it should fit about 6 of these drives as time goes on.

A couple quick edits to my backup script and the new safe drive is part of the mix.

I feel safer already.

Tuesday, 22 February 2011

I’m Still O.K.

“Martin Van Buren was a big part of OK’s initial takeoff”

“Van Buren’s unsuccessful reelection campaign in 1840 is regarded by etymologists as instrumental in the popularization of the word ‘OK’. In the context of the campaign, the initialism was used as a nickname for Van Buren and stood for ‘Old Kinderhook,’ which was a reference to Van Buren’s birthplace.”

Despite the reminders when my sideburns get to long – the 8th president and I are not related.

Oh sure – he lost his 2nd term – but his campaign lives on in everyday speech? I’d count that as a success.

Too bad about the successors. :/

“your comments may be used in advertising or exploited in some other way we haven’t figured out yet”

Monday, 21 February 2011

Tuesday, 15 February 2011

Pinecone Passions: A Star Tribune Community eBook

I’ve been working with the Star Tribune on a number of very exciting new projects.

The first of these project is an ebook version of Pinecone Passions -the short romance story written by the Star Tribune community for Valentines day, 2011.

It’s now available in the Amazon Kindle store for $2.99 – with other ebook stores coming soon.

Pinecone Passions in Amazon’s Kindle store