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…
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. When you install MySQL it defaults to auto starting at login. I like to have control over when the services that I use for development are started and stopped–hence I start Apache 2, ColdFusion and PostFIx from a terminal window when I’m getting ready to work. Until today, I had just lived with the fact that MySQL started automatically when you logged in. I finally got off my lazy butt and decided to do some searching on the command-line syntax to start and stop MySQL.
As is generally my luck, it’s taking me longer to write this post than it did to find the answer in the “new evil empire” (that’s Google for those of you like me that haven’t joined the anti-Google bandwagon yet). The commands are pretty straightforward but it’s still nice to set up an alias in your terminal profile so you don’t have to remember them. They are:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
I set an alias for each of those in my .bash_profile so I only have to type mysql-start and mysql-stop respectively. The only other thing you’ll want to do is remove the startup item from /Library/StartupItems with the following command:
sudo rm -rf /Library/StartupItems/MySQLCOM/
Many thanks to this blog post on the “explorer’s club” blog (specifically steps 3.3 and 4.3) for getting me on the right track.
Just a quick note to mention that my blog is now running off my virtual private server at SliceHost. My server is running Fedora Core 6, Apache 2.2 and MySQL 5. It is using the 512MB / 20GB plan that SliceHost offers.
There was some disucssion on the CFTalk list today about how bad of an idea it is to run your database server on the same box as your application server. For the most part I completely agree that the workload should be divided between boxes. However, this server just hosts a few hobby sites (like this blog and my amateur radio site www.n4ea.ws) and some development “preview” sites that we set up during the development process for client projects. With that low amount of traffic, I don’t think there will be any problem with this box doing what I need it to do.
This is the first site that I’ve migrated, but I’ll be doing several others in the next couple of days as I rotate everything off the Windows 2003 Small Business Server that is here in the house.
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.
The bad part about the situation (which my lovely wife is in the process of fixing as I write this) is that my shiny new Macbook Pro was delivered to my house on Thursday. Sooo…I’ll have to wait a couple more days before I can get my hands on it. She is shipping it up here to the office so hopefully I’ll have it sometime Monday and can start setting it up. I have to give my current Dell laptop to my cousin on Wednesday night next week so it’ll be a horse race to try to get ColdFusion, CFEclipse, MySQL etc all set up and working correctly by then.
Anyway, “every cloud has a silver lining” they say. This one is that my schedule for this weekend just got cleared so I’m going to try to make some headway on some side work I have pending.
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.
As part of the conversion project, I thought I’d be really cute and import the OCR text layer of the PDFs into a field in the table and set up a Verity index that included that field. I figured, hey, this will give the client something he doesn’t have today and make me look good in the process right?
Grrrrr….
Read more…