<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dan&#039;s Drivelings &#187; MySQL</title>
	<atom:link href="http://www.tntechnohermit.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tntechnohermit.com</link>
	<description>Random Thoughts of a Techno-Hermit</description>
	<lastBuildDate>Thu, 01 Sep 2011 16:37:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Database bullet dodging and lessons learned</title>
		<link>http://www.tntechnohermit.com/2009/04/12/database-bullet-dodging-and-lessons-learned/</link>
		<comments>http://www.tntechnohermit.com/2009/04/12/database-bullet-dodging-and-lessons-learned/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 03:56:08 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=182</guid>
		<description><![CDATA[I dodged a very large (metaphorical) bullet yesterday. I&#8217;m not in the habit of trying to find bullets to dodge, but this one found me because it tuns out I didn&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>I dodged a very large (metaphorical) bullet yesterday. I&#8217;m not in the habit of trying to find bullets to dodge, but this one found me because it tuns out I didn&#8217;t plan as well as I thought I had. </p>
<p>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&#8217;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&#8217;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.<br />
<span id="more-182"></span></p>
<p>So, here&#8217;s to lessons learned:</p>
<ul>
<li>Don&#8217;t do production database work late at night. The root of the problem was that I misread the client&#8217;s original email and wrote my script incorrectly because of it. Part of that failing was the late hour and long day that preceded it.</li>
<li>Plan, plan, plan and re-plan. Thinking my one backup was sufficient was my second mistake. When working with production data, you can absolutely not be &#8220;too backed up&#8221;</li>
<li>Test your scripts on non-production systems first. This client doesn&#8217;t have a dedicated development system, but I do have a few-weeks-old copy of the database on my development machine. Another mistake I made was being lazy and not testing these changes on my local copy before applying them to production</li>
<li>Have a plan in place to verify the database changes as soon as they&#8217;re made. My cursory inspection of the data didn&#8217;t reveal the actual problems that occurred. If I had done this when the client was available to test the changes, we&#8217;d have been able to immediately restore the database and assess what went wrong.</li>
<li>Nothing is ever as simple as it seems. These updates seemed like a walk in the park and lulled me into not taking the precautions I knew I should have</li>
</ul>
<p>So, in the end, my client has his data back where it belongs and I have a few things I&#8217;ve learned I&#8217;ll never do again. My biggest embarrassment in this whole thing is that I consider myself a senior developer.  I&#8217;ve been writing web apps for almost 10 years across Oracle, MS SQL, MySQL and PostGres databases and I should have known better than to take shortcuts. My only excuse is that I&#8217;m human and I can only try to learn from my mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2009/04/12/database-bullet-dodging-and-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Start/Stop MySQL from a terminal session on OS X</title>
		<link>http://www.tntechnohermit.com/2008/07/29/startstop-mysql-from-a-terminal-session-on-os-x/</link>
		<comments>http://www.tntechnohermit.com/2008/07/29/startstop-mysql-from-a-terminal-session-on-os-x/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 03:01:20 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=75</guid>
		<description><![CDATA[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. Start: sudo /usr/local/mysql/support-files/mysql.server start Stop: sudo /usr/local/mysql/support-files/mysql.server stop]]></description>
			<content:encoded><![CDATA[<p>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. </p>
<p>Start:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>support-files<span style="color: #000000; font-weight: bold;">/</span>mysql.server start</pre></div></div>

<p>Stop:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>support-files<span style="color: #000000; font-weight: bold;">/</span>mysql.server stop</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2008/07/29/startstop-mysql-from-a-terminal-session-on-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server migration complete</title>
		<link>http://www.tntechnohermit.com/2007/06/21/server-migration-complete/</link>
		<comments>http://www.tntechnohermit.com/2007/06/21/server-migration-complete/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 22:12:03 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[Amateur Radio]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/2007/06/21/server-migration-complete/</guid>
		<description><![CDATA[Just a quick note to mention that my blog is now running off my virtual private server at]]></description>
			<content:encoded><![CDATA[<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">Just a quick note to mention that my blog is now running off my virtual private server at</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2007/06/21/server-migration-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stuck in D.C.</title>
		<link>http://www.tntechnohermit.com/2007/03/17/stuck-in-dc/</link>
		<comments>http://www.tntechnohermit.com/2007/03/17/stuck-in-dc/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 17:12:29 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/2007/03/17/stuck-in-dc/</guid>
		<description><![CDATA[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&#8217;t get me back to Nashville until Sunday. Since [...]]]></description>
			<content:encoded><![CDATA[<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">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&#8217;t get me back to Nashville until Sunday. Since I had to be back up here Monday, it didn&#8217;t make sense to do that, so I&#8217;m just not going home this weekend.</p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">
]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2007/03/17/stuck-in-dc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verity woes this week</title>
		<link>http://www.tntechnohermit.com/2007/01/12/verity-woes-this-week/</link>
		<comments>http://www.tntechnohermit.com/2007/01/12/verity-woes-this-week/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 13:22:01 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/2007/01/12/verity-woes-this-week/</guid>
		<description><![CDATA[I&#8217;ve been in Charlotte, NC this week for my &#8220;day&#8221; job and have been working on a side project from the hotel that involves converting a large amount of data from a, let&#8217;s just say, &#8220;non-standard&#8221; database program to MySQL. One of the tables stores information about 14,000+ legal documents that we have in PDF [...]]]></description>
			<content:encoded><![CDATA[<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">I&#8217;ve been in Charlotte, NC this week for my &#8220;day&#8221; job and have been working on a side project from the hotel that involves converting a large amount of data from a, let&#8217;s just say, &#8220;non-standard&#8221; database program to MySQL. One of the tables stores information about 14,000+ legal documents that we have in PDF format on the filesystem.</p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">
]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2007/01/12/verity-woes-this-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse/Ant/MySQL goodness</title>
		<link>http://www.tntechnohermit.com/2007/01/01/eclipseantmysql-goodness/</link>
		<comments>http://www.tntechnohermit.com/2007/01/01/eclipseantmysql-goodness/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 02:40:15 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/2007/01/01/eclipseantmysql-goodness/</guid>
		<description><![CDATA[I&#8217;ve spent several hours this past weekend working on a project for a client that uses a MySQL database backend. It involves converting thousands of records from XML files exported from the legacy data system. One of the things that&#8217;s been bugging me is the process that I have to go to every time I [...]]]></description>
			<content:encoded><![CDATA[<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">I&#8217;ve spent several hours this past weekend working on a project for a client that uses a MySQL database backend. It involves converting thousands of records from XML files exported from the legacy data system. One of the things that&#8217;s been bugging me is the process that I have to go to every time I make changes to the the database or import more data into my local development copy in order to get those changes/data up to the staging server.</p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px">
]]></content:encoded>
			<wfw:commentRss>http://www.tntechnohermit.com/2007/01/01/eclipseantmysql-goodness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

