<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Developing Software in J2EE</title>
	<atom:link href="http://devinj2ee.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://devinj2ee.wordpress.com</link>
	<description>Developing Software in J2EE</description>
	<lastBuildDate>Tue, 15 Jun 2010 16:36:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devinj2ee.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Developing Software in J2EE</title>
		<link>http://devinj2ee.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://devinj2ee.wordpress.com/osd.xml" title="Developing Software in J2EE" />
	<atom:link rel='hub' href='http://devinj2ee.wordpress.com/?pushpress=hub'/>
		<item>
		<title>HSQLDB &#8211; What a piece of &#8230;..</title>
		<link>http://devinj2ee.wordpress.com/2010/06/15/hsqldb-what-a-piece-of/</link>
		<comments>http://devinj2ee.wordpress.com/2010/06/15/hsqldb-what-a-piece-of/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 16:36:22 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Derby]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[HSQLDB]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=389</guid>
		<description><![CDATA[First, I know I haven&#8217;t posted in a while&#8230; I&#8217;ve been extremely busy.  Will there be more posts sooner rather than later?  Probably not.  But I&#8217;ve not abandoned this project.  I just need to find some time and I don&#8217;t have any right now. Now, on to the post. I needed a small lightweight database that I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=389&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First, I know I haven&#8217;t posted in a while&#8230; I&#8217;ve been extremely busy.  Will there be more posts sooner rather than later?  Probably not.  But I&#8217;ve not abandoned this project.  I just need to find some time and I don&#8217;t have any right now.</p>
<p>Now, on to the post.</p>
<p>I needed a small lightweight database that I could embed in an application that I was writing.  I looked around (not very hard) and came across HSQLDB and just picked it at random more or less.  What a piece of crap this database is and here&#8217;s why:</p>
<p>1. I&#8217;d had the database up and my tables created and I needed to add a new column.  The database would not let me.  Gave me some ridiculous error message about &#8220;<em>String data right truncation&#8221;. </em>I don&#8217;t have the full error message, and would rather not post it to be honest in case a search engine picks it up (and some poor soul thinks I have the answer) but it was esoteric and useless.  I saw some post somewhere about copying the data out of the table into a temp table and then back.  Crazy.</p>
<p>2. I use NetBeans for my IDE.  I also use it for manipulating my databases.  It&#8217;s not the best but it does most of my work for me.  When you do a simple select, NetBeans limits the number of rows to 20.  Every time I tried to do a select, with an HSQLDB database, with NetBeans, and the table had more than 20 rows, it would crash. CRASH!  Some form of nullpointerexception.  If I changed the number (20) to greater than the number of rows in the table, everything was fine.</p>
<p>3. The final straw was when it started dropping data.  The application I wrote, would start up the database, put data in it and then shut it down.  If there were 2 rows, the final row would get lost.  To be fair, this could have been my application that did this (although I don&#8217;t think so).  Because it really felt like it wasn&#8217;t flushing the data from memory into the database.  I say this because if the database was just &#8220;running&#8221; and I would run the application then both rows would get put into the database.  Again, I don&#8217;t think so though.  The database shouldn&#8217;t drop data.</p>
<p>So, I&#8217;m done with it.  HSQLDB is a complete piece of crap as far as I&#8217;m concerned.  I&#8217;m looking at Derby at the moment.  It seems much more stable.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=389&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2010/06/15/hsqldb-what-a-piece-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; Apache HTTP Server (Windows)</title>
		<link>http://devinj2ee.wordpress.com/2010/01/25/environment-consistency-apache-http-server-windows/</link>
		<comments>http://devinj2ee.wordpress.com/2010/01/25/environment-consistency-apache-http-server-windows/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:50:37 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=357</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=357&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>Here we&#8217;re going to be install the Apache HTTP Web Server.  We are going to download the HTTP Server from Apache&#8217;s website.  The file I downloaded is &#8220;apache_2.2.14-win32-x86-no_ssl.msi&#8221;.</p>
<p>After downloading the file, double click on it and start the installer which will show this dialog box:</p>
<div id="attachment_366" class="wp-caption aligncenter" style="width: 412px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-13-pm.png"><img class="size-full wp-image-366" title="Installing Apache Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-13-pm.png" alt="Installing Apache Screen" width="402" height="304" /></a><p class="wp-caption-text">Installing Apache Screen</p></div>
<p>Click &#8220;Run&#8221; and you&#8217;ll see this dialog box:</p>
<div id="attachment_368" class="wp-caption aligncenter" style="width: 511px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-45-pm1.png"><img class="size-full wp-image-368" title="Apache Installation Wizard Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-45-pm1.png" alt="Apache Installation Wizard Screen" width="501" height="385" /></a><p class="wp-caption-text">Apache Installation Wizard Screen</p></div>
<p>Click &#8220;Next&#8221; and this dialog box will appear:</p>
<div id="attachment_369" class="wp-caption aligncenter" style="width: 510px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-41-27-pm.png"><img class="size-full wp-image-369" title="Apache Installation Wizard License Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-41-27-pm.png" alt="Apache Installation Wizard License Screen" width="500" height="384" /></a><p class="wp-caption-text">Apache Installation Wizard License Screen</p></div>
<p>Click &#8220;I accept the terms in license agreement&#8221; and then click &#8220;Next&#8221; to show this dialog box:</p>
<div id="attachment_370" class="wp-caption aligncenter" style="width: 512px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-42-17-pm.png"><img class="size-full wp-image-370" title="Apache Installation Wizard Read Me Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-42-17-pm.png" alt="Apache Installation Wizard Read Me Screen" width="502" height="386" /></a><p class="wp-caption-text">Apache Installation Wizard Read Me Screen</p></div>
<p>Click &#8220;Next&#8221;</p>
<div id="attachment_371" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-43-07-pm.png"><img class="size-full wp-image-371" title="Apache Installation Wizard Server Configuration" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-43-07-pm.png" alt="Apache Installation Wizard Server Configuration" width="503" height="385" /></a><p class="wp-caption-text">Apache Installation Wizard Server Configuration</p></div>
<p>On this screen you may want to edit the items.  I just left it as the defaults and clicked on &#8220;Next&#8221;</p>
<div id="attachment_372" class="wp-caption aligncenter" style="width: 511px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-03-pm.png"><img class="size-full wp-image-372" title="Apache Installation Wizard Setup Type Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-03-pm.png" alt="Apache Installation Wizard Setup Type Screen" width="501" height="385" /></a><p class="wp-caption-text">Apache Installation Wizard Setup Type Screen</p></div>
<p>Click on &#8220;Custom&#8221; and then click &#8220;Next&#8221;</p>
<div id="attachment_373" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-44-pm.png"><img class="size-full wp-image-373" title="Apache Installation Wizard Custom Setup Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-44-pm.png" alt="Apache Installation Wizard Custom Setup Screen" width="503" height="386" /></a><p class="wp-caption-text">Apache Installation Wizard Custom Setup Screen</p></div>
<p>Again, just leave the defaults and click &#8220;Next&#8221; to see this dialog box:</p>
<div id="attachment_374" class="wp-caption aligncenter" style="width: 510px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-45-32-pm.png"><img class="size-full wp-image-374" title="Apache Installation Wizard Install Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-45-32-pm.png" alt="Apache Installation Wizard Install Screen" width="500" height="383" /></a><p class="wp-caption-text">Apache Installation Wizard Install Screen</p></div>
<p>Click &#8220;Install&#8221; to start the installation process and you should see a window like the following:</p>
<div id="attachment_375" class="wp-caption aligncenter" style="width: 514px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-46-12-pm.png"><img class="size-full wp-image-375" title="Apache Installation In Progress Screen" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-46-12-pm.png" alt="Apache Installation In Progress Screen" width="504" height="385" /></a><p class="wp-caption-text">Apache Installation In Progress Screen</p></div>
<p>You may see some DOS boxes pop up during the installation process as well.  They&#8217;re harmless.</p>
<p>After the installation completes, you&#8217;ll see the following dialog box:</p>
<div id="attachment_376" class="wp-caption aligncenter" style="width: 511px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-47-21-pm.png"><img class="size-full wp-image-376" title="Apache Installation Wizard Completed" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-47-21-pm.png" alt="Apache Installation Wizard Completed" width="501" height="387" /></a><p class="wp-caption-text">Apache Installation Wizard Completed</p></div>
<p>Click Finish.</p>
<p>Apache is now installed and is started automatically.  You&#8217;ll see a little icon down in the task bar that looks like this:</p>
<div id="attachment_377" class="wp-caption aligncenter" style="width: 64px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-48-22-pm.png"><img class="size-full wp-image-377" title="Apache Icon" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-48-22-pm.png" alt="Apache Icon" width="54" height="41" /></a><p class="wp-caption-text">Apache Icon</p></div>
<p>You can stop and start the server using this.  But the server is already started so let&#8217;s confirm that it&#8217;s running by going to http://localhost.  You should see the following in your browser when you do this:</p>
<div id="attachment_378" class="wp-caption aligncenter" style="width: 476px"><a href="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-50-00-pm.png"><img class="size-full wp-image-378" title="Apache Installation Confirmation" src="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-50-00-pm.png" alt="Apache Installation Confirmation" width="466" height="302" /></a><p class="wp-caption-text">Apache Installation Confirmation</p></div>
<p>You&#8217;re done!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=357&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2010/01/25/environment-consistency-apache-http-server-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-13-pm.png" medium="image">
			<media:title type="html">Installing Apache Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-40-45-pm1.png" medium="image">
			<media:title type="html">Apache Installation Wizard Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-41-27-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard License Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-42-17-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Read Me Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-43-07-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Server Configuration</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-03-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Setup Type Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-44-44-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Custom Setup Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-45-32-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Install Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-46-12-pm.png" medium="image">
			<media:title type="html">Apache Installation In Progress Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-47-21-pm.png" medium="image">
			<media:title type="html">Apache Installation Wizard Completed</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-48-22-pm.png" medium="image">
			<media:title type="html">Apache Icon</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2010/01/screen-shot-2010-01-19-at-6-50-00-pm.png" medium="image">
			<media:title type="html">Apache Installation Confirmation</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; MySQL (Windows)</title>
		<link>http://devinj2ee.wordpress.com/2009/12/21/environment-consistency-mysql-windows/</link>
		<comments>http://devinj2ee.wordpress.com/2009/12/21/environment-consistency-mysql-windows/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 06:26:31 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=317</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=317&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>I really don’t use MySQL too much.  At work, I have Oracle and Sybase.  But I think I’m going to use it in the example code that I post later.  Because we’ll be using Hibernate, for the most part, it really doesn’t matter.  Hibernate hides the nuances of each type of database from us (for the most part).  Anyway, the real reason has to do with the fact we&#8217;ll be installing PHP (which we&#8217;ve already done for the Apple Macintosh in an earlier <a title="Environment Consistency - PHP (Apple Macintosh)" href="http://wp.me/pED03-3o" target="_self">post</a> and we&#8217;ll be doing for Windows in a later post).  We&#8217;ll also need it for WordPress which we&#8217;ll also be addressing in a later post.</p>
<p>Here we’re going to install MySQL for Windows.  We’ve already installed it for the Apple Macintosh in an earlier <a title="Environment Consistency - MySQL (Apple Macintosh)" href="http://wp.me/pED03-3X">post</a>.</p>
<p>First off, we need the binary.  We’ll go to the <a title="MySQL Website" href="http://dev.mysql.com/downloads/" target="_blank">MySQL website</a> to download the 5.1 MySQL version file called “mysql-essential-5.1.41-win32.msi”.  After we’ve gotten the file downloaded double click it and we’ll see this window.</p>
<p><em>Note: You may have downloaded the 64 bit version of MySQL which is completely fine.</em></p>
<div id="attachment_318" class="wp-caption aligncenter" style="width: 412px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-36-59-pm.png"><img class="size-full wp-image-318" title="Open File - Security Warning MySQL AB" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-36-59-pm.png" alt="Open File - Security Warning MySQL AB" width="402" height="292" /></a><p class="wp-caption-text">Open File - Security Warning MySQL AB</p></div>
<p>Click &#8220;Run&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_319" class="wp-caption aligncenter" style="width: 514px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-37-33-pm.png"><img class="size-full wp-image-319" title="MySQL 5.1.41 Installer Welcome Screen" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-37-33-pm.png" alt="MySQL 5.1.41 Installer Welcome Screen" width="504" height="384" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Welcome Screen</p></div>
<p>Click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_320" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-38-38-pm.png"><img class="size-full wp-image-320" title="MySQL Server 5.1 - Setup Wizard" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-38-38-pm.png" alt="MySQL Server 5.1 - Setup Wizard" width="505" height="384" /></a><p class="wp-caption-text">MySQL Server 5.1 - Setup Wizard</p></div>
<p>Click on the &#8220;Custom&#8221; radio button and click &#8220;Next &gt;&#8221;.  You will see this window:</p>
<div id="attachment_321" class="wp-caption aligncenter" style="width: 514px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-44-47-pm.png"><img class="size-full wp-image-321" title="MySQL 5.1.41 Installer Welcome Screen (Custom Setup)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-44-47-pm.png" alt="MySQL 5.1.41 Installer Welcome Screen (Custom Setup)" width="504" height="385" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Welcome Screen (Custom Setup)</p></div>
<p>There&#8217;s no reason not to leave the defaults so click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_322" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-22-pm.png"><img class="size-full wp-image-322" title="MySQL 5.1.41 Installer Welcome Screen (Custom Setup)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-22-pm.png" alt="MySQL 5.1.41 Installer Welcome Screen (Custom Setup)" width="505" height="386" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Welcome Screen (Custom Setup)</p></div>
<p>Click &#8220;Install&#8221; and you&#8217;ll see a window similar to the following:</p>
<div id="attachment_323" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-56-pm.png"><img class="size-full wp-image-323" title="MySQL 5.1.41 Installer (Installing)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-56-pm.png" alt="MySQL 5.1.41 Installer (Installing)" width="505" height="387" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer (Installing)</p></div>
<p>Once the software has completed installing you&#8217;ll see the following window:</p>
<div id="attachment_324" class="wp-caption aligncenter" style="width: 516px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-02-pm.png"><img class="size-full wp-image-324" title="MySQL Enterprise Ad" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-02-pm.png" alt="MySQL Enterprise Ad" width="506" height="386" /></a><p class="wp-caption-text">MySQL Enterprise Ad</p></div>
<p>Click &#8220;Next &gt;&#8221; here and you&#8217;ll see this window:</p>
<div id="attachment_325" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-36-pm.png"><img class="size-full wp-image-325" title="MySQL Enterprise Monitor Ad" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-36-pm.png" alt="MySQL Enterprise Monitor Ad" width="505" height="384" /></a><p class="wp-caption-text">MySQL Enterprise Monitor Ad</p></div>
<p>Click &#8220;Next &gt;&#8221; again and now you&#8217;ll see this window:</p>
<div id="attachment_326" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-48-16-pm.png"><img class="size-full wp-image-326" title="MySQL Setup Wizard Finished" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-48-16-pm.png" alt="MySQL Setup Wizard Finished" width="503" height="385" /></a><p class="wp-caption-text">MySQL Setup Wizard Finished</p></div>
<p>I deselect the &#8220;Register the MySQL Server now&#8221; but you can leave it checked.  It&#8217;s up to you.  Now click &#8220;Finish&#8221; and you&#8217;ll see this window which is the configuration wizard:</p>
<div id="attachment_327" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-18-pm.png"><img class="size-full wp-image-327" title="MySQL Server Configuration Instance" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-18-pm.png" alt="MySQL Server Configuration Instance" width="503" height="381" /></a><p class="wp-caption-text">MySQL Server Configuration Instance</p></div>
<p>Click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_328" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-50-pm.png"><img class="size-full wp-image-328" title="MySQL Instance Configuration Wizard (Type)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-50-pm.png" alt="MySQL Instance Configuration Wizard (Type)" width="505" height="386" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (Type)</p></div>
<p>Leave &#8220;Detailed Configuration&#8221; checked and click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_343" class="wp-caption aligncenter" style="width: 510px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-12-pm.png"><img class="size-full wp-image-343" title="MySQL Instance Configuration Wizard (Detailed Configuration)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-12-pm.png" alt="MySQL Instance Configuration Wizard (Detailed Configuration)" width="500" height="386" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (Detailed Configuration)</p></div>
<p>Leave &#8220;Developer Machine&#8221; checked and click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_344" class="wp-caption aligncenter" style="width: 517px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-23-pm.png"><img class="size-full wp-image-344" title="MySQL Instance Configuration Wizard (Multifunction Database)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-23-pm.png" alt="MySQL Instance Configuration Wizard (Multifunction Database)" width="507" height="384" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (Multifunction Database)</p></div>
<p>Leave &#8220;Multifunctional Database&#8221; checked and click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_345" class="wp-caption aligncenter" style="width: 512px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-33-pm.png"><img class="size-full wp-image-345" title="MySQL Instance Configuration Wizard (InnoDB Database)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-33-pm.png" alt="MySQL Instance Configuration Wizard (InnoDB Database)" width="502" height="383" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (InnoDB Database)</p></div>
<p>I&#8217;m leaving the defaults selected on my machine but you may want to put the database on a different disk if you have one.  Click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_346" class="wp-caption aligncenter" style="width: 510px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-51-pm.png"><img class="size-full wp-image-346" title="MySQL Instance Configuration Wizard (Connections)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-51-pm.png" alt="MySQL Instance Configuration Wizard (Connections)" width="500" height="383" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (Connections)</p></div>
<p>Leave the default of &#8220;Decision Support (DSS)/OLAP&#8221; selected as we won&#8217;t be making a lot of concurrent connections to our machine while we&#8217;re developing software.  Click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_330" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-54-08-pm.png"><img class="size-full wp-image-330" title="MySQL Instance Configuration Wizard (Network)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-54-08-pm.png" alt="MySQL Instance Configuration Wizard (Network)" width="503" height="385" /></a><p class="wp-caption-text">MySQL Instance Configuration Wizard (Network)</p></div>
<p>You&#8217;re probably behind a firewall on a corporate LAN so you should be OK to leave these defaults (the port specifically).  Click &#8220;Next &gt;&#8221; and you&#8217;ll see this window:</p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-55-13-pm.png"><img class="size-full wp-image-331" title="MySQL Server Instance Configuration (Character Set)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-55-13-pm.png" alt="MySQL Server Instance Configuration (Character Set)" width="505" height="385" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Character Set)</p></div>
<p>We may do some multi-lingual development so let&#8217;s change this to &#8220;Best Support for Multilingualism&#8221; and the window will look like this:</p>
<div id="attachment_332" class="wp-caption aligncenter" style="width: 514px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-56-36-pm.png"><img class="size-full wp-image-332" title="MySQL Server Instance Configuration (Character Set)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-56-36-pm.png" alt="MySQL Server Instance Configuration (Character Set)" width="504" height="386" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Character Set)</p></div>
<p>Click &#8220;Next &gt;&#8221; and you&#8217;ll see a window like this:</p>
<div id="attachment_333" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-57-22-pm.png"><img class="size-full wp-image-333" title="MySQL Server Instance Configuration (Windows Service)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-57-22-pm.png" alt="MySQL Server Instance Configuration (Windows Service)" width="505" height="386" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Windows Service)</p></div>
<p>We want to keep &#8220;Install As Windows Service&#8221; checked so that MySQL will start up for us automatically.  And we&#8217;re also going to check &#8220;Include Bin Directory in Windows PATH&#8221;.  The window should look like this:</p>
<div id="attachment_334" class="wp-caption aligncenter" style="width: 512px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-58-56-pm.png"><img class="size-full wp-image-334" title="MySQL Server Instance Configuration (Windows Service)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-58-56-pm.png" alt="MySQL Server Instance Configuration (Windows Service)" width="502" height="385" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Windows Service)</p></div>
<p>Click &#8220;Next &gt;&#8221; and you should see this window:</p>
<div id="attachment_335" class="wp-caption aligncenter" style="width: 516px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-59-59-pm.png"><img class="size-full wp-image-335" title="MySQL Server Instance Configuration (Accounts)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-59-59-pm.png" alt="MySQL Server Instance Configuration (Accounts)" width="506" height="384" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Accounts)</p></div>
<p>Enter a &#8220;New root password:&#8221; and &#8220;Confirm:&#8221;.  We then click &#8220;Next &gt;&#8221; and will see this window:</p>
<div id="attachment_336" class="wp-caption aligncenter" style="width: 512px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-02-pm.png"><img class="size-full wp-image-336" title="MySQL Server Instance Configuration (Ready to Execute)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-02-pm.png" alt="MySQL Server Instance Configuration (Ready to Execute)" width="502" height="386" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Ready to Execute)</p></div>
<p>Click &#8220;Execute&#8221; and you&#8217;ll see a window similar to this:</p>
<p style="text-align:left;">
<div id="attachment_337" class="wp-caption aligncenter" style="width: 513px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-58-pm.png"><img class="size-full wp-image-337" title="MySQL Server Instance Configuration (Executing)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-58-pm.png" alt="MySQL Server Instance Configuration (Executing)" width="503" height="384" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Executing)</p></div>
<p>When it&#8217;s finished, you should see this window:</p>
<div id="attachment_338" class="wp-caption aligncenter" style="width: 515px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-03-47-pm.png"><img class="size-full wp-image-338 " title="MySQL Server Instance Configuration (Finished Executing)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-03-47-pm.png" alt="MySQL Server Instance Configuration (Executing)" width="505" height="387" /></a><p class="wp-caption-text">MySQL Server Instance Configuration (Finished Executing)</p></div>
<p>Click &#8220;Finish&#8221;.  Let&#8217;s reboot and the system should come up with MySQL started and everything in place.</p>
<p>When that&#8217;s done, let&#8217;s start up a command window by clicking on &#8220;Start&#8221; and then &#8220;Run&#8221; and typing &#8220;Cmd&#8221;.  You should see a window like this:</p>
<div id="attachment_339" class="wp-caption aligncenter" style="width: 354px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-11-12-pm.png"><img class="size-full wp-image-339" title="Windows Run Window" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-11-12-pm.png" alt="Windows Run Window" width="344" height="183" /></a><p class="wp-caption-text">Windows Run Window</p></div>
<p>Click &#8220;OK&#8221; and you should see a window like this:</p>
<div id="attachment_340" class="wp-caption aligncenter" style="width: 680px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-05-pm.png"><img class="size-full wp-image-340" title="Windows CMD Window" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-05-pm.png" alt="Windows CMD Window" width="670" height="337" /></a><p class="wp-caption-text">Windows CMD Window</p></div>
<p>Type in the following</p>
<blockquote><p>mysql -u root -p</p></blockquote>
<p>and you should see a window like this:</p>
<div id="attachment_341" class="wp-caption aligncenter" style="width: 680px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-55-pm.png"><img class="size-full wp-image-341" title="mysql -u root -p" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-55-pm.png" alt="mysql -u root -p" width="670" height="337" /></a><p class="wp-caption-text">mysql -u root -p</p></div>
<p>Enter the password that you chose for your root password and you should see a screen like this:</p>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 679px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-46-13-pm.png"><img class="size-full wp-image-342" title="Logged into MySQL" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-46-13-pm.png" alt="Logged into MySQL" width="669" height="339" /></a><p class="wp-caption-text">Logged into MySQL</p></div>
<p>And you&#8217;re done!  You&#8217;ve now got MySQL installed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=317&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/12/21/environment-consistency-mysql-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-36-59-pm.png" medium="image">
			<media:title type="html">Open File - Security Warning MySQL AB</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-37-33-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Welcome Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-38-38-pm.png" medium="image">
			<media:title type="html">MySQL Server 5.1 - Setup Wizard</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-44-47-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Welcome Screen (Custom Setup)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-22-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Welcome Screen (Custom Setup)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-45-56-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer (Installing)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-02-pm.png" medium="image">
			<media:title type="html">MySQL Enterprise Ad</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-47-36-pm.png" medium="image">
			<media:title type="html">MySQL Enterprise Monitor Ad</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-48-16-pm.png" medium="image">
			<media:title type="html">MySQL Setup Wizard Finished</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-18-pm.png" medium="image">
			<media:title type="html">MySQL Server Configuration Instance</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-49-50-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (Type)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-12-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (Detailed Configuration)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-23-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (Multifunction Database)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-33-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (InnoDB Database)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-9-42-51-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (Connections)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-54-08-pm.png" medium="image">
			<media:title type="html">MySQL Instance Configuration Wizard (Network)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-55-13-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Character Set)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-56-36-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Character Set)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-57-22-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Windows Service)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-58-56-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Windows Service)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-7-59-59-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Accounts)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-02-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Ready to Execute)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-01-58-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Executing)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-03-47-pm.png" medium="image">
			<media:title type="html">MySQL Server Instance Configuration (Finished Executing)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-11-12-pm.png" medium="image">
			<media:title type="html">Windows Run Window</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-05-pm.png" medium="image">
			<media:title type="html">Windows CMD Window</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-12-55-pm.png" medium="image">
			<media:title type="html">mysql -u root -p</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-12-21-at-8-46-13-pm.png" medium="image">
			<media:title type="html">Logged into MySQL</media:title>
		</media:content>
	</item>
		<item>
		<title>MAMP</title>
		<link>http://devinj2ee.wordpress.com/2009/12/13/mamp/</link>
		<comments>http://devinj2ee.wordpress.com/2009/12/13/mamp/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 01:51:03 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=303</guid>
		<description><![CDATA[We have now created a MAMP (Macintosh, Apache, MySQL, PHP) environment.  This posting is just to group those particular posts together: Environment Consistency &#8211; PHP (Apple Macintosh) Environment Consistency &#8211; MySQL (Apple Macintosh) Environment Consistency &#8211; PHP/MySQL Configuration (Apple Macintosh) Environment consistency &#8211; Verify PHP to MySQL Connectivity (Apple Macintosh)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=303&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have now created a MAMP (Macintosh, Apache, MySQL, PHP) environment.  This posting is just to group those particular posts together:</p>
<p><a title="Environment Consistency - PHP (Apple Macintosh)" href="http://wp.me/pED03-3o" target="_self">Environment Consistency &#8211; PHP (Apple Macintosh)</a></p>
<p><a title="Environment Consistency - MySQL (Apple Macintosh)" href="http://wp.me/pED03-3X" target="_self">Environment Consistency &#8211; MySQL (Apple Macintosh)</a></p>
<p><a title="Environment Consistency - PHP/MySQL Configuration (Apple Macintosh)" href="http://wp.me/pED03-4u" target="_self">Environment Consistency &#8211; PHP/MySQL Configuration (Apple Macintosh)</a></p>
<p><a title="Environment Consistency - Verify PHP to MySQL Connectivity (Apple Macintosh)" href="http://wp.me/pED03-4w">Environment consistency &#8211; Verify PHP to MySQL Connectivity (Apple Macintosh)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=303&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/12/13/mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; Verify PHP to MySQL Connectivity (Apple Macintosh)</title>
		<link>http://devinj2ee.wordpress.com/2009/12/13/12-14-09-environment-consistency-verify-php-to-mysql-connectivity-apple-macintosh/</link>
		<comments>http://devinj2ee.wordpress.com/2009/12/13/12-14-09-environment-consistency-verify-php-to-mysql-connectivity-apple-macintosh/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 01:50:26 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=280</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=280&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>This post will show how to do a verification that PHP is talking to our MySQL database for the Apple Macintosh.  We&#8217;ll go back and show how to do it for Windows in a later post.</p>
<p>So, to do a test, to make sure we&#8217;re talking to the database, we start up NetBeans and click on &#8220;File&#8221;, &#8220;New Project&#8221; which will give us this dialog box:</p>
<div id="attachment_292" class="wp-caption aligncenter" style="width: 733px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-07-am.png"><img class="size-full wp-image-292" title="New Project PHP Application" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-07-am.png" alt="New Project PHP Application" width="723" height="500" /></a><p class="wp-caption-text">New Project PHP Application</p></div>
<p>Now click on &#8220;PHP&#8221;, &#8220;PHP Application&#8221; and click &#8220;Next&#8221; which will give us a dialog box that looks like this:</p>
<div id="attachment_293" class="wp-caption aligncenter" style="width: 733px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-30-am.png"><img class="size-full wp-image-293" title="New PHP Project" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-30-am.png" alt="New PHP Project" width="723" height="499" /></a><p class="wp-caption-text">New PHP Project</p></div>
<p>We&#8217;re entering &#8220;PhpDbTest&#8221; for the &#8220;Project Name:&#8221; and need to make sure that our &#8220;Sources Folder:&#8221; is &#8220;PhpDbTest&#8221; as well.  Click &#8220;Next &gt;&#8221; and you should see this dialog box:</p>
<div id="attachment_294" class="wp-caption aligncenter" style="width: 664px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-55-15-am.png"><img class="size-full wp-image-294" title="New PHP Project (Project URL)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-55-15-am.png" alt="New PHP Project (Project URL)" width="654" height="391" /></a><p class="wp-caption-text">New PHP Project (Project URL)</p></div>
<p>As noted when we set up <a title="Environment Consistency - PHP (Apple Macintosh)" href="http://wp.me/pED03-3o" target="_self">PHP</a>, I run my applications out of my &#8220;/Users/thcampbell/Sites&#8221; directory so I click the &#8220;Copy files from Sources Folder to another location&#8221; and &#8220;Browse&#8230;&#8221; to that directory so that it shows up in the &#8220;Copy to Folder:&#8221; area of the dialog box.  I also change the &#8220;Project URL:&#8221; so that it reads &#8220;http://localhost/~thcampbell/PhpDbTest&#8221;.  <em> </em></p>
<p><em>You&#8217;ll need to substitute your username where I&#8217;m using &#8220;thcampbell&#8221;</em></p>
<p>After making these changes the dialog box should look like this:</p>
<div id="attachment_295" class="wp-caption aligncenter" style="width: 746px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-02-15-am.png"><img class="size-full wp-image-295" title="Project URL Modification" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-02-15-am.png" alt="Project URL Modification" width="736" height="424" /></a><p class="wp-caption-text">Project URL Modification</p></div>
<p>Click &#8220;Finish&#8221;</p>
<p>Now NetBeans is going to start up and automatically opens an &#8220;index.php&#8221; file for us and we&#8217;re going to add the following (highlighted) between &#8220;&lt;?php&#8221; and &#8220;?&gt;&#8221;</p>
<div id="attachment_296" class="wp-caption aligncenter" style="width: 694px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-19-50-am.png"><img class="size-full wp-image-296" title="PHP Database Connectivity Code" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-19-50-am.png" alt="PHP Database Connectivity Code" width="684" height="455" /></a><p class="wp-caption-text">PHP Database Connectivity Code</p></div>
<p>What&#8217;s going on here is that we are setting up a couple of variables for connecting to our database:</p>
<blockquote><p>$dbhost = &#8216;localhost&#8217;;<br />
$dbuser = &#8216;root&#8217;;<br />
$dbpass = &#8216;xxxxxx&#8217;;</p></blockquote>
<p>You would, of course, want to change the &#8216;xxxxxx&#8217; to your database password from when we hooked up <a title="Environment Consistency - MySQL (Apple Macintosh)" href="http://wp.me/pED03-3X" target="_blank">MySQL</a> for our Apple machine.</p>
<p>The following line will do the actual connection to our database and if there is an error it will quit and throw an error message:</p>
<blockquote><p>$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (&#8216;Error connecting to mysql&#8217;);</p></blockquote>
<p>The following line does a select query of &#8220;Host&#8221; and &#8220;User&#8221; from the &#8220;mysql.user&#8221; table in our database:</p>
<blockquote><p>$result = mysql_query(&#8220;SELECT Host,User from mysql.user&#8221;);</p></blockquote>
<p>The &#8220;mysql.user&#8221; table is always there and holds the information of users that have access to our database as we saw when we hooked up our database in an earlier <a title="Environment Consistency - MySQL (Apple Macintosh)" href="http://wp.me/pED03-3X" target="_blank">post</a>.</p>
<p>These lines will display the data to our browser when we run the program:</p>
<blockquote><p>while($row = mysql_fetch_array($result)) {<br />
echo $row['Host'] . &#8221; &#8221; . $row['User'];<br />
echo &#8220;&lt;br /&gt;&#8221;;<br />
}</p></blockquote>
<p>and finally, let&#8217;s be a good boy or girl and close our database connection:</p>
<blockquote><p>mysql_close($conn);</p></blockquote>
<p>So, let&#8217;s run it from NetBeans by right clicking on our Project Name &#8220;PhpDbTest&#8221; and clicking on &#8220;Run&#8221;.  The default browser should start up and you should see a screen similar to the following:</p>
<div id="attachment_297" class="wp-caption aligncenter" style="width: 500px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-25-31-am.png"><img class="size-full wp-image-297" title="PHP/MySQL Successful Test" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-25-31-am.png" alt="PHP/MySQL Successful Test" width="490" height="312" /></a><p class="wp-caption-text">PHP/MySQL Successful Test</p></div>
<p>If you see this screen then you&#8217;re done!  You connected to the database without any problem.</p>
<p>However, maybe you see this screen:</p>
<div id="attachment_298" class="wp-caption aligncenter" style="width: 562px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-26-54-am.png"><img class="size-full wp-image-298" title="PHP/MySQL Unsuccessful Test" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-26-54-am.png" alt="PHP/MySQL Unsuccessful Test" width="552" height="315" /></a><p class="wp-caption-text">PHP/MySQL Unsuccessful Test</p></div>
<p>It&#8217;s probably your username or password for your database that is incorrect.  It is also possible you don&#8217;t have your PHP talking to MySQL properly but that&#8217;s fairly unlikely if you did the steps in this <a title="Environment Consistency - PHP/MySQL Configuration (Apple Macintosh)" href="http://wp.me/pED03-4u" target="_self">post</a>.</p>
<p>If you can&#8217;t figure it out or something else went wrong post something in the comments section and maybe I or someone else can help.</p>
<p>I used information from the following sites for this posting</p>
<p><a title="W3Schools" href="http://www.w3schools.com/PHP/php_mysql_select.asp" target="_blank">http://www.w3schools.com/PHP/php_mysql_select.asp</a></p>
<p><a title="PHP MySQL Tutorial" href="http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/connect-to-mysql-database.aspx" target="_blank">http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/connect-to-mysql-database.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/280/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=280&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/12/13/12-14-09-environment-consistency-verify-php-to-mysql-connectivity-apple-macintosh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-07-am.png" medium="image">
			<media:title type="html">New Project PHP Application</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-54-30-am.png" medium="image">
			<media:title type="html">New PHP Project</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-55-15-am.png" medium="image">
			<media:title type="html">New PHP Project (Project URL)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-02-15-am.png" medium="image">
			<media:title type="html">Project URL Modification</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-19-50-am.png" medium="image">
			<media:title type="html">PHP Database Connectivity Code</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-25-31-am.png" medium="image">
			<media:title type="html">PHP/MySQL Successful Test</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-10-26-54-am.png" medium="image">
			<media:title type="html">PHP/MySQL Unsuccessful Test</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; PHP/MySQL Configuration (Apple Macintosh)</title>
		<link>http://devinj2ee.wordpress.com/2009/12/06/environment-consistency-phpmysql-configuration-apple-macintosh/</link>
		<comments>http://devinj2ee.wordpress.com/2009/12/06/environment-consistency-phpmysql-configuration-apple-macintosh/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 02:38:26 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=278</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=278&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>We&#8217;ve installed <a title="Environment Consistency - PHP (Apple Macintosh)" href="http://wp.me/pED03-3o" target="_self">PHP</a> and <a title="Environment Consistency - MySQL (Apple Macintosh)" href="http://wp.me/pED03-3X" target="_self">MySQL</a> but we haven&#8217;t &#8220;connected&#8221; the two of them.  We&#8217;re going to do that today and it&#8217;s actually pretty easy to do.  All we have to do is tell PHP where the MySQL socket file is located.  The PHP we installed, thinks it is going to be at &#8220;/var/mysql/mysql.sock&#8221;.  However, on our Apple Macintosh it isn&#8217;t located there.  It&#8217;s located at &#8220;/tmp/mysql.sock&#8221;.  All we have to do is start up a &#8220;Terminal&#8221; session and edit our &#8220;php.ini&#8221; file using &#8220;sudo&#8221; like so:</p>
<div id="attachment_282" class="wp-caption aligncenter" style="width: 593px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-30-at-9-36-06-am.png"><img class="size-full wp-image-282" title="sudo vi /etc/php.ini" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-30-at-9-36-06-am.png" alt="sudo vi /etc/php.ini" width="583" height="354" /></a><p class="wp-caption-text">sudo vi /etc/php.ini</p></div>
<p>and we then find the line that starts &#8220;mysql.default_socket&#8221; like so (it&#8217;s highlighted):</p>
<div id="attachment_283" class="wp-caption aligncenter" style="width: 594px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-37-09-am.png"><img class="size-full wp-image-283 " title="mysql.default_socket (before)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-37-09-am.png" alt="mysql.default_socket" width="584" height="353" /></a><p class="wp-caption-text">mysql.default_socket (before)</p></div>
<p>and change it from &#8220;/var/mysql/mysql.sock&#8221; to &#8220;/tmp/mysql.sock&#8221; like so (again highlighted):</p>
<div id="attachment_284" class="wp-caption aligncenter" style="width: 595px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-38-43-am.png"><img class="size-full wp-image-284" title="mysql.default_socket (after)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-38-43-am.png" alt="mysql.default_socket (after)" width="585" height="352" /></a><p class="wp-caption-text">mysql.default_socket (after)</p></div>
<p>now we have another line that starts &#8220;pdo_mysql.default_socket&#8221; that we also need to change.  We&#8217;re changing it in the same way.  From &#8220;/var/mysql/mysql.sock&#8221; to &#8220;/tmp/mysql.sock&#8221;.  Here are two screen shots of the before and after:</p>
<div id="attachment_285" class="wp-caption aligncenter" style="width: 647px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-51-45-am.png"><img class="size-full wp-image-285" title="pdo_mysql.default_socket (before)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-51-45-am.png" alt="pdo_mysql.default_socket (before)" width="637" height="396" /></a><p class="wp-caption-text">pdo_mysql.default_socket (before)</p></div>
<div id="attachment_286" class="wp-caption aligncenter" style="width: 647px"><a href="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-52-10-am.png"><img class="size-full wp-image-286" title="pdo_mysql.default_socket (after)" src="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-52-10-am.png" alt="pdo_mysql.default_socket (after)" width="637" height="394" /></a><p class="wp-caption-text">pdo_mysql.default_socket (after)</p></div>
<p>save it and you&#8217;re done!</p>
<p>Reboot to make sure everything gets re-initialized.  This may be unnecessary but what&#8217;s it hurt?</p>
<p>Next week, I&#8217;ll show you how to verify that you&#8217;re talking to the database.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=278&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/12/06/environment-consistency-phpmysql-configuration-apple-macintosh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-30-at-9-36-06-am.png" medium="image">
			<media:title type="html">sudo vi /etc/php.ini</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-37-09-am.png" medium="image">
			<media:title type="html">mysql.default_socket (before)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-38-43-am.png" medium="image">
			<media:title type="html">mysql.default_socket (after)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-51-45-am.png" medium="image">
			<media:title type="html">pdo_mysql.default_socket (before)</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/12/screen-shot-2009-11-30-at-9-52-10-am.png" medium="image">
			<media:title type="html">pdo_mysql.default_socket (after)</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; MySQL (Apple Macintosh)</title>
		<link>http://devinj2ee.wordpress.com/2009/11/22/environment-consistency-mysql/</link>
		<comments>http://devinj2ee.wordpress.com/2009/11/22/environment-consistency-mysql/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 01:22:40 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=245</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=245&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>I really don&#8217;t use MySQL too much.  At work, I have Oracle and Sybase.  But I think I&#8217;m going to use it in the example code that I post later.  Because we&#8217;ll be using Hibernate, for the most part, it really doesn&#8217;t matter.  Hibernate hides the nuances of each type of database from us (for the most part).  Anyway, the real reason has to do with our <a title="Environment Consistency - PHP (Apple Macintosh)" href="http://wp.me/pED03-3o" target="_self">earlier PHP post</a> and a post about WordPress that I&#8217;ll be making later.  ]</p>
<p>Here we&#8217;re going to install MySQL for the Macintosh.  We&#8217;ll go back and do it for Windows in a later <a title="Environment Consistency - MySQL (Windows)" href="http://wp.me/pED03-57">post</a>.</p>
<p>First off, we need the binary.  We&#8217;ll go to the <a title="MySQL Website" href="http://dev.mysql.com/downloads/" target="_blank">MySQL website</a> to download the 5.1 MySQL version file called &#8220;mysql-5.1.41-osx10.5-x86.dmg&#8221;.  After we&#8217;ve gotten that downloaded double click it and we&#8217;ll see this window after the image has been mounted:</p>
<div id="attachment_268" class="wp-caption aligncenter" style="width: 695px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png"><img class="size-full wp-image-268" title="Mounted MySQL Package" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png" alt="Mounted MySQL Package" width="685" height="171" /></a><p class="wp-caption-text">Mounted MySQL Package</p></div>
<p>Now click on the icon for &#8220;mysql-5.1.41-osx10.5-x86.pkg&#8221; and you should see this window:</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 632px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-35-48-pm.png"><img class="size-full wp-image-250" title="MySQL 5.1.41 Installer Welcome Screen" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-35-48-pm.png" alt="MySQL 5.1.41 Installer Welcome Screen" width="622" height="441" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Welcome Screen</p></div>
<p>click &#8220;Continue&#8221;</p>
<div id="attachment_251" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-02-pm.png"><img class="size-full wp-image-251" title="MySQL 5.1.41 Installer Important Information" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-02-pm.png" alt="MySQL 5.1.41 Installer Important Information" width="621" height="443" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Important Information</p></div>
<p>click &#8220;Continue&#8221;</p>
<div id="attachment_252" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-17-pm.png"><img class="size-full wp-image-252" title="MySQL 5.1.41 Installer Software License Agreement" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-17-pm.png" alt="MySQL 5.1.41 Installer Software License Agreement" width="621" height="443" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Software License Agreement</p></div>
<p>click &#8220;Continue&#8221; and a window will drop down</p>
<div id="attachment_253" class="wp-caption aligncenter" style="width: 516px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-42-pm.png"><img class="size-full wp-image-253" title="MySQL 5.1.41 Installer Agree to Software" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-42-pm.png" alt="MySQL 5.1.41 Installer Agree to Software" width="506" height="181" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Agree to Software</p></div>
<p>click &#8220;Agree&#8221;</p>
<div id="attachment_254" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-56-pm.png"><img class="size-full wp-image-254" title="MySQL 5.1.41 Installer Select A Destination" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-56-pm.png" alt="MySQL 5.1.41 Installer Select A Destination" width="621" height="443" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Select A Destination</p></div>
<p>click &#8220;Continue&#8221;</p>
<div id="attachment_255" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-13-pm.png"><img class="size-full wp-image-255" title="MySQL 5.1.41 Installer Confirm Install Location" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-13-pm.png" alt="MySQL 5.1.41 Installer Confirm Install Location" width="621" height="442" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Confirm Install Location</p></div>
<p>click &#8220;Install&#8221;</p>
<div id="attachment_256" class="wp-caption aligncenter" style="width: 456px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-43-pm.png"><img class="size-full wp-image-256" title="MySQL 5.1.41 Installer Enter Password" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-43-pm.png" alt="MySQL 5.1.41 Installer Enter Password" width="446" height="247" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Enter Password</p></div>
<p>you&#8217;ll need to type in your password so that you&#8217;ll have permission to install the software and after you&#8217;ve done that, the software should start to install</p>
<div id="attachment_257" class="wp-caption aligncenter" style="width: 632px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-58-pm.png"><img class="size-full wp-image-257" title="MySQL 5.1.41 Installer Installing" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-58-pm.png" alt="MySQL 5.1.41 Installer Installing" width="622" height="445" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Installing</p></div>
<p>and when it&#8217;s done you&#8217;ll see this window:</p>
<div id="attachment_258" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-38-40-pm.png"><img class="size-full wp-image-258" title="MySQL 5.1.41 Installer Successful Install" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-38-40-pm.png" alt="MySQL 5.1.41 Installer Successful Install" width="621" height="442" /></a><p class="wp-caption-text">MySQL 5.1.41 Installer Successful Install</p></div>
<p>Now you have the MySQL database installed.  But you don&#8217;t want to have to start it by hand every time your system boots.  You&#8217;d rather it start automatically for you.  We have an app for that. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Go back to this window</p>
<div id="attachment_268" class="wp-caption aligncenter" style="width: 695px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png"><img class="size-full wp-image-268" title="Mounted MySQL Package" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png" alt="Mounted MySQL Package" width="685" height="171" /></a><p class="wp-caption-text">Mounted MySQL Package</p></div>
<p>and this time click on &#8220;MySqlStartupItem.pkg&#8221; and you&#8217;ll see this window</p>
<div id="attachment_271" class="wp-caption aligncenter" style="width: 628px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png"><img class="size-full wp-image-271" title="MySQL 5.1.41 Startup Item Installer Welcome Screen" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png" alt="MySQL 5.1.41 Startup Item Installer Welcome Screen" width="618" height="443" /></a><p class="wp-caption-text">MySQL 5.1.41 Startup Item Installer Welcome Screen</p></div>
<p>click Continue</p>
<div id="attachment_271" class="wp-caption aligncenter" style="width: 628px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png"><img class="size-full wp-image-271" title="MySQL 5.1.41 Startup Item Installer Welcome Screen" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png" alt="MySQL 5.1.41 Startup Item Installer Welcome Screen" width="618" height="443" /></a><p class="wp-caption-text">MySQL 5.1.41 Startup Item Installer Welcome Screen</p></div>
<p>click Continue</p>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-55-pm.png"><img class="size-full wp-image-261" title="MySQL 5.1.41 Startup Item Installer Select Destination" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-55-pm.png" alt="MySQL 5.1.41 Startup Item Installer Select Destination" width="621" height="442" /></a><p class="wp-caption-text">MySQL 5.1.41 Startup Item Installer Select Destination</p></div>
<p>click Continue</p>
<div id="attachment_262" class="wp-caption aligncenter" style="width: 631px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-23-pm.png"><img class="size-full wp-image-262" title="MySQL 5.1.41 Startup Item Installer Confirm Destination" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-23-pm.png" alt="MySQL 5.1.41 Startup Item Installer Confirm Destination" width="621" height="444" /></a><p class="wp-caption-text">MySQL 5.1.41 Startup Item Installer Confirm Destination</p></div>
<p>click Install</p>
<div id="attachment_263" class="wp-caption aligncenter" style="width: 629px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-51-pm.png"><img class="size-full wp-image-263" title="MySQL 5.1.41 Startup Item Installer Successful Install" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-51-pm.png" alt="MySQL 5.1.41 Startup Item Installer Successful Install" width="619" height="447" /></a><p class="wp-caption-text">MySQL 5.1.41 Startup Item Installer Successful Install</p></div>
<p>and you&#8217;re done.  Click Close.</p>
<p>We could go through the process of starting MySQL by hand but it&#8217;s just as easy to reboot our machine.  That way we&#8217;ll know it starts automatically for us as well.  So, reboot!</p>
<p>After you&#8217;ve rebooted, let&#8217;s start up a &#8220;Terminal&#8221; window.  Once that&#8217;s done, type in the following command:</p>
<blockquote><p>ps -aef | grep mysql</p></blockquote>
<p>and you should see results that look similar to this:</p>
<div id="attachment_264" class="wp-caption aligncenter" style="width: 668px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-49-49-pm.png"><img class="size-full wp-image-264" title="MySQL 5.1.41 Confirm Install" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-49-49-pm.png" alt="MySQL 5.1.41 Confirm Install" width="658" height="339" /></a><p class="wp-caption-text">MySQL 5.1.41 Confirm Install</p></div>
<p>MySQL doesn&#8217;t have a Graphical User Interface so a lot of what we&#8217;ll be doing is via the command line.  Because of this, we need to put the /usr/local/mysql/bin in our PATH environment to make life easier for us.  We do this by cd-ing to the /etc directory and then editing the profile file using vi (via sudo).  We&#8217;ll be executing these commands:</p>
<blockquote><p>cd /etc<br />
sudo vi profile</p></blockquote>
<p>and our window should look like this:</p>
<div id="attachment_269" class="wp-caption aligncenter" style="width: 696px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-34-32-pm.png"><img class="size-full wp-image-269" title="MySQL 5.1.41 Edit /etc/profile" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-34-32-pm.png" alt="MySQL 5.1.41 Edit /etc/profile" width="686" height="269" /></a><p class="wp-caption-text">MySQL 5.1.41 Edit /etc/profile</p></div>
<p>In this file, you should see a line that says PATH.  You want to put the line &#8220;/usr/local/mysql/bin:&#8221; right after the = sign of that line.  You should see a window that looks like this:</p>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 696px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-42-05-pm.png"><img class="size-full wp-image-270" title="MySQL 5.1.41 Change PATH" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-42-05-pm.png" alt="MySQL 5.1.41 Change PATH" width="686" height="269" /></a><p class="wp-caption-text">MySQL 5.1.41 Change PATH</p></div>
<p>Save it and end your Terminal session and start a new one so that this will take effect for you.</p>
<p>Now that the MySQL server is started, we need to get in and do some things for security reasons.  The server starts with no password for the &#8220;root&#8221; user and it also has an anonymous account.  We need to fix those issues.  So we start up a &#8220;Terminal&#8221; window again and we&#8217;ll be executing the following command to get us into the MySQL interface:</p>
<blockquote><p>mysql -u root</p></blockquote>
<p>and the first thing we&#8217;re going to do is delete the anonymous users by running this command:</p>
<blockquote><p>DELETE FROM mysql.user WHERE user=&#8221;;</p></blockquote>
<p>your window will look like this:</p>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 659px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-58-46-pm.png"><img class="size-full wp-image-266" title="MySQL 5.1.41 Delete Anonymous Users" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-58-46-pm.png" alt="MySQL 5.1.41 Delete Anonymous Users" width="649" height="355" /></a><p class="wp-caption-text">MySQL 5.1.41 Delete Anonymous Users</p></div>
<p>And finally we need to get in and change the password for our root user.  Start up a &#8220;Terminal&#8221; window and get in MySQL by this command:</p>
<blockquote><p>mysql -u root</p></blockquote>
<p>then run the following command</p>
<blockquote><p>UPDATE mysql.user SET password = PASSWORD=(&#8216;xxxxxx&#8217;);</p></blockquote>
<p>Be aware here though.  First off, you&#8217;re changing ALL the passwords of ALL the users in your database.  This is a fresh install so that&#8217;s OK but if for some reason you&#8217;re following this and it&#8217;s not a fresh install then be aware.  Secondly, I&#8217;m changing the password to &#8216;xxxxxx&#8217;, you&#8217;ll want to change it to something real.</p>
<p>How will we know that our password has been changed?  We now have to add the &#8220;-p&#8221; argument when we try to get into MySQL from now on else we can&#8217;t get in.  So we&#8217;ll be executing a command like this</p>
<blockquote><p>mysql -u root -p</p></blockquote>
<p>and the server will now ask you for the password when you try to get into your server.</p>
<p>The window for this will look like the following for these commands:</p>
<div id="attachment_267" class="wp-caption aligncenter" style="width: 700px"><a href="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-10-29-08-pm.png"><img class="size-full wp-image-267" title="MySQL 5.1.41 Change root Password" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-10-29-08-pm.png" alt="MySQL 5.1.41 Change root Password" width="690" height="421" /></a><p class="wp-caption-text">MySQL 5.1.41 Change root Password</p></div>
<p>We now have MySQL installed on our Apple Macintosh.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=245&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/11/22/environment-consistency-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png" medium="image">
			<media:title type="html">Mounted MySQL Package</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-35-48-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Welcome Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-02-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Important Information</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-17-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Software License Agreement</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-42-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Agree to Software</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-36-56-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Select A Destination</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-13-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Confirm Install Location</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-43-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Enter Password</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-37-58-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Installing</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-38-40-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Installer Successful Install</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-21-04-pm.png" medium="image">
			<media:title type="html">Mounted MySQL Package</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Startup Item Installer Welcome Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-06-pm1.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Startup Item Installer Welcome Screen</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-39-55-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Startup Item Installer Select Destination</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-23-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Startup Item Installer Confirm Destination</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-40-51-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Startup Item Installer Successful Install</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-49-49-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Confirm Install</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-34-32-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Edit /etc/profile</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-22-at-12-42-05-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Change PATH</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-9-58-46-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Delete Anonymous Users</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-20-at-10-29-08-pm.png" medium="image">
			<media:title type="html">MySQL 5.1.41 Change root Password</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; PHP (Apple Macintosh)</title>
		<link>http://devinj2ee.wordpress.com/2009/11/18/environment-consistency-php/</link>
		<comments>http://devinj2ee.wordpress.com/2009/11/18/environment-consistency-php/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 18:11:52 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=210</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=210&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>Where I work, I&#8217;m asked to work on other technologies all the time.  My main focus is to work in JAVA/J2EE but sometimes I have to work in other programming languages.  PHP is one of those languages.</p>
<p>Today we&#8217;re going to set up our Apple Macintosh for working and debugging PHP in NetBeans.  I&#8217;ll show you how to set up PHP for Windows use in a later post.</p>
<p><em>In this file I&#8217;m going to refer to &#8220;&lt;username&gt;&#8221;.  This will be your username on your laptop similar to how mine is &#8220;thcampbell&#8221;</em></p>
<p>If you didn&#8217;t know it already, your Apple Macintosh already has an Apache HTTP web server on it.  You can get to it by going to &#8220;System Preferences&#8221; and then clicking on &#8220;Sharing&#8221;.  From there you&#8217;ll see something that says &#8220;Web Sharing&#8221; and it is probably off.</p>
<div id="attachment_214" class="wp-caption aligncenter" style="width: 680px"><img class="size-full wp-image-214" title="Web Sharing on Apple" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-17-18-am.png" alt="Web Sharing on Apple" width="670" height="550" /><p class="wp-caption-text">Web Sharing on Apple</p></div>
<p>Click on the check box next to the Web Sharing line to turn it on:</p>
<div id="attachment_215" class="wp-caption aligncenter" style="width: 679px"><img class="size-full wp-image-215" title="Web Sharing on Apple" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-17-35-am.png" alt="Web Sharing on Apple" width="669" height="552" /><p class="wp-caption-text">Web Sharing on Apple</p></div>
<p>After you&#8217;ve done that, click on the link that&#8217;s presented on this page or go to &#8220;http://localhost/~&lt;username&gt;&#8221; in your favorite browser.  You should see a screen like this:</p>
<div id="attachment_216" class="wp-caption aligncenter" style="width: 843px"><img class="size-full wp-image-216" title="Apache HTTP Web Server on Apple" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-19-39-am.png" alt="Apache HTTP Web Server on Apple" width="833" height="819" /><p class="wp-caption-text">Apache HTTP Web Server on Apple</p></div>
<p>Ok, we have the server running and believe it or not, PHP is <em>also</em> on your Apple Macintosh already.  We just have to enable it.  So start up a &#8220;Terminal&#8221; session and cd to the &#8220;/etc/apache2&#8243; directory.  Then execute (via sudo) the vi command to edit the file &#8220;httpd.conf&#8221;:</p>
<div id="attachment_218" class="wp-caption aligncenter" style="width: 740px"><img class="size-full wp-image-218" title="Edit httpd.conf using sudo/vi" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-06-40-pm.png" alt="Edit httpd.conf using sudo/vi" width="730" height="341" /><p class="wp-caption-text">Edit httpd.conf using sudo/vi</p></div>
<p>After you&#8217;re editing the file, find the line that looks like the following:</p>
<blockquote><p>#LoadModule php5_module libexec_apache2/libphp5.so</p></blockquote>
<p>and uncomment it (remove the # sign).  When you&#8217;re done the file will look like the following:</p>
<p style="text-align:center;">
<div id="attachment_217" class="wp-caption aligncenter" style="width: 643px"><img class="size-full wp-image-217 " title="Editing LoadModule line" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-23-09-am.png" alt="Editing LoadModule line" width="633" height="439" /><p class="wp-caption-text">Editing LoadModule line</p></div>
<p>Save it!</p>
<p>Now we need to restart our Apache HTTP web server.  Easy enough, go back to &#8220;System Preferences&#8221; and then &#8220;Sharing&#8221;, from there uncheck the check box for &#8220;Web Sharing&#8221; and then check it again.  This will stop and restart your server.</p>
<p>But how do we know PHP is running properly?</p>
<p>Go to your &#8220;Terminal&#8221; session and &#8220;cd ${HOME}/Sites&#8221;.  This will be the &#8220;Sites&#8221; directory under your username on the system.  In this directory create a file (using vi) called &#8220;phpinfo.php&#8221;.  In this file put the following line</p>
<blockquote><p>&lt;?php phpinfo(); ?&gt;</p></blockquote>
<p>Your file will look like this:</p>
<div id="attachment_219" class="wp-caption aligncenter" style="width: 738px"><img class="size-full wp-image-219" title="phpinfo.php" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-13-37-pm.png" alt="phpinfo.php" width="728" height="340" /><p class="wp-caption-text">phpinfo.php</p></div>
<p>Save it.</p>
<p>Now go to your browser at &#8220;http://localhost/~&lt;username&gt;/phpinfo.php&#8221; and you should see a screen that looks like the following:</p>
<div id="attachment_220" class="wp-caption aligncenter" style="width: 989px"><img class="size-full wp-image-220" title="http://localhost/~&lt;username&gt;/phpinfo.php" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-25-59-am.png" alt="http://localhost/~&lt;username&gt;/phpinfo.php" width="979" height="794" /><p class="wp-caption-text">http://localhost/~/phpinfo.php</p></div>
<p>The next thing we need to do is set up PHP so that we can debug our software easily.  We do this by using Xdebug.  Get the Xdebug source files from <a title="XDebug Download Site" href="http://www.xdebug.org/download.php" target="_blank">http://www.xdebug.org/download.php</a>.  You want to get the latest source and download it to your machine.  After you&#8217;ve done that, go to a &#8220;Terminal&#8221; session and go to the directory where you downloaded the files.  (More than likely ${HOME}/Downloads)  Now run gunzip and tar on the file like so:</p>
<div id="attachment_221" class="wp-caption aligncenter" style="width: 823px"><img class="size-full wp-image-221" title="gunzip and tar xvf xdebug" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-24-12-pm.png" alt="gunzip and tar xvf xdebug" width="813" height="243" /><p class="wp-caption-text">gunzip and tar xvf xdebug</p></div>
<p>After you&#8217;ve done that, you need to cd into the directory where the sources are kept.  In the case of the file I downloaded they are in &#8220;xdebug-2.0.5&#8243; and from here I&#8217;m going to run &#8220;sudo phpize&#8221; and &#8220;./configure &#8211;enable-Xdebug&#8221; like so:</p>
<div id="attachment_222" class="wp-caption aligncenter" style="width: 823px"><img class="size-full wp-image-222" title="phpize and configure of xdebug" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-28-02-pm.png" alt="phpize and configure of xdebug" width="813" height="242" /><p class="wp-caption-text">phpize and configure of xdebug</p></div>
<p>and finally I&#8217;m going to run make:</p>
<div id="attachment_223" class="wp-caption aligncenter" style="width: 822px"><img class="size-full wp-image-223" title="make xdebug" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-28-46-pm.png" alt="make xdebug" width="812" height="241" /><p class="wp-caption-text">make xdebug</p></div>
<p>Now we should have a file in the modules subdirectory called xdebug.so:</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 821px"><img class="size-full wp-image-224" title="xdebug.so" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-30-01-pm.png" alt="xdebug.so" width="811" height="241" /><p class="wp-caption-text">xdebug.so</p></div>
<p>We need to copy this file to our extensions directory.  Where is that at?  We go back to our phpinfo program that we ran in the browser at &#8220;http://localhost/~&lt;username&gt;/phpinfo.php&#8221;.  The information displayed in the browser should have a section labeled Core which should have an entry for &#8220;extension_dir&#8221;.</p>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 837px"><img class="size-full wp-image-225" title="Core and extension_dir in phpinfo.php" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-31-56-pm.png" alt="Core and extension_dir in phpinfo.php" width="827" height="882" /><p class="wp-caption-text">Core and extension_dir in phpinfo.php</p></div>
<p>We want to put the &#8220;xdebug.so&#8221; file in this directory.  We&#8217;ll do this using &#8220;sudo&#8221; like so:</p>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 821px"><img class="size-full wp-image-226" title="Move xdebug.so into extension_dir" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-34-04-pm.png" alt="Move xdebug.so into extension_dir" width="811" height="242" /><p class="wp-caption-text">Move xdebug.so into extension_dir</p></div>
<p>We now need to edit our &#8220;php.ini&#8221; file.  But where is it?  Well PHP doesn&#8217;t have to have a php.ini file to run and on our Apple Macintosh there&#8217;s not one.  If you again, look at the phpinfo program that we ran in the browser at &#8220;http://localhost/~username/phpinfo.php&#8221; you&#8217;ll notice a line that says &#8220;Configuration File (php.ini) Path&#8221;.  Mine says &#8220;/etc&#8221; and if you look in &#8220;/etc&#8221; for &#8220;php.ini&#8221; the file is not there.  But there is a file called &#8220;php.ini.default&#8221;.  Just copy it (using &#8220;sudo&#8221;) and then we&#8217;ll edit it (using &#8220;sudo vi&#8221;) like so:</p>
<div id="attachment_227" class="wp-caption aligncenter" style="width: 823px"><img class="size-full wp-image-227" title="cp php.ini.default to php.ini" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-38-36-pm.png" alt="cp php.ini.default to php.ini" width="813" height="242" /><p class="wp-caption-text">cp php.ini.default to php.ini</p></div>
<p>At the bottom of this file we want to put the following lines:</p>
<blockquote><p>; Xdebug config for Mac OS X and NetBeans IDE<br />
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so<br />
xdebug.remote_enable=on<br />
xdebug.remote_handler=dbgp<br />
; xdebug.remote_mode=req<br />
xdebug.remote_host=localhost<br />
xdebug.remote_port=9000<br />
; xdebug.idekey=</p></blockquote>
<p>and our file will look like this (the lines we added are highlighted):</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 822px"><img class="size-full wp-image-228" title="php.ini file edited with xdebug information" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-39-49-pm.png" alt="php.ini file edited with xdebug information" width="812" height="244" /><p class="wp-caption-text">php.ini file edited with xdebug information</p></div>
<p>Now, we need to stop and restart our server again.  Again, this is done by going to &#8220;System Preferences&#8221;, &#8220;Sharing&#8221; and unchecking and checking the box next to &#8220;Web Sharing&#8221;.</p>
<p>Now, how do we know if our debug mode is ready?  Again, we go to &#8220;http://localhost/~&lt;username&gt;/phpinfo.php&#8221; and in this file there should be a section title &#8220;XDebug&#8221; like so:</p>
<div id="attachment_229" class="wp-caption aligncenter" style="width: 844px"><img class="size-full wp-image-229" title="XDebug in phpinfo.php" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-42-11-pm.png" alt="XDebug in phpinfo.php" width="834" height="588" /><p class="wp-caption-text">XDebug in phpinfo.php</p></div>
<p>Ok, now we&#8217;ve got PHP running, in debug mode, but we want to be able to create and debug programs in NetBeans.  This is pretty simple to do as well, let&#8217;s do a test.</p>
<p>Click on File and New Project and the following dialog box should come up</p>
<div id="attachment_230" class="wp-caption aligncenter" style="width: 733px"><img class="size-full wp-image-230" title="New PHP Project" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-15-44-pm.png" alt="New PHP Project" width="723" height="503" /><p class="wp-caption-text">New PHP Project</p></div>
<p>Click Next and you may see the following dialog box as well:</p>
<div id="attachment_231" class="wp-caption aligncenter" style="width: 732px"><img class="size-full wp-image-231" title="Activating PHP" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-30-32-am.png" alt="Activating PHP" width="722" height="500" /><p class="wp-caption-text">Activating PHP</p></div>
<p>I had some problems with this on the Apple Macintosh (it just stayed on this screen).  Give it a few minutes and then hit the &#8220;&lt; Back&#8221; button.  Everything seemed to be OK for me when I did this.</p>
<p>So, now (if we had to, we clicked on File and New Project again) we should see the following dialog box where we will enter &#8220;TestPHPProject&#8221; in as the &#8220;Project Name&#8221; and &#8220;/NetBeansProjects/TestPHPProject&#8221; as the &#8220;Sources Folder:&#8221;</p>
<div id="attachment_232" class="wp-caption aligncenter" style="width: 733px"><img class="size-full wp-image-232" title="TestPHPProject" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-46-07-pm.png" alt="TestPHPProject" width="723" height="499" /><p class="wp-caption-text">TestPHPProject</p></div>
<p>Now, click &#8220;Next &gt;&#8221; and you&#8217;ll see this dialog box:</p>
<div id="attachment_233" class="wp-caption aligncenter" style="width: 710px"><img class="size-full wp-image-233" title="PHP Project Configuration" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-48-31-pm.png" alt="PHP Project Configuration" width="700" height="394" /><p class="wp-caption-text">PHP Project Configuration</p></div>
<p>Change the Project URL to be &#8220;http://localhost/~&lt;username&gt;/TestPHPProject&#8221;</p>
<p>Click on the &#8220;Copy files from Sources Folder to another location&#8221; button and then click the &#8220;Browse&#8221; button.  You want to browse to &#8220;/Users/&lt;username&gt;/Sites&#8221;.  The resulting dialog box will look like the following:</p>
<div id="attachment_234" class="wp-caption aligncenter" style="width: 710px"><img class="size-full wp-image-234" title="TestPHPProject Edited Configuration" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-50-33-pm.png" alt="TestPHPProject Edited Configuration" width="700" height="396" /><p class="wp-caption-text">TestPHPProject Edited Configuration</p></div>
<p>After that&#8217;s done, NetBeans will open up the &#8220;index.php&#8221; file for your Project.  Put the following line</p>
<blockquote><p>phpinfo();</p></blockquote>
<p>in this file so that it looks like this:</p>
<div id="attachment_235" class="wp-caption aligncenter" style="width: 776px"><img class="size-full wp-image-235" title="index.php in NetBeans with phpinfo();" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-52-52-pm.png" alt="index.php in NetBeans with phpinfo();" width="766" height="537" /><p class="wp-caption-text">index.php in NetBeans with phpinfo();</p></div>
<p>Now, you&#8217;re ready to go.  In NetBeans, click on &#8220;Debug&#8221; and then &#8220;Debug Project (TestPHPProject)&#8221; and the program should start and it will stop at the first line like so:</p>
<div id="attachment_236" class="wp-caption aligncenter" style="width: 775px"><img class="size-full wp-image-236" title="NetBeans index.php file being debugged" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-55-54-pm.png" alt="NetBeans index.php file being debugged" width="765" height="537" /><p class="wp-caption-text">NetBeans index.php file being debugged</p></div>
<p>You can now step through this file or any other PHP file you create.</p>
<p>I&#8217;d like to credit the following articles that I used for research in regards to creating this post:</p>
<p><a title="Configuring PHP, Apache, MySQL, and Xdebug for PHP development in MAC OS X" href="http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html" target="_blank">Configuring PHP, Apache, MySQL, and Xdebug for PHP development in MAC OS X</a></p>
<p><a title="Debugging PHP Source Code in the NetBeans IDE for PHP Editor" href="http://netbeans.org/kb/docs/php/debugging.html" target="_blank">Debugging PHP Source Code in the NetBeans IDE for PHP Editor</a></p>
<p><a title="Using Apache and PHP on Mac OS X" href="http://www.devarticles.com/c/a/Apache/Using-Apache-and-PHP-on-Mac-OS-X/" target="_blank">Using Apache and PHP on Mac OS X</a></p>
<p><a title="Working with PHP 5 in Mac OS X 10.5 (Leopard)" href="http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/" target="_blank">Working with PHP 5 in Mac OS X 10.5 (Leopard)</a></p>
<p><a title="Where is php.ini under MAC OSX" href="http://www.wellho.net/forum/Writing-PHP/Where-is-php-ini-under-Mac-OSX.html" target="_blank">Where is php.ini under MAC OSX</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/210/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=210&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/11/18/environment-consistency-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-17-18-am.png" medium="image">
			<media:title type="html">Web Sharing on Apple</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-17-35-am.png" medium="image">
			<media:title type="html">Web Sharing on Apple</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-19-39-am.png" medium="image">
			<media:title type="html">Apache HTTP Web Server on Apple</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-06-40-pm.png" medium="image">
			<media:title type="html">Edit httpd.conf using sudo/vi</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-23-09-am.png" medium="image">
			<media:title type="html">Editing LoadModule line</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-13-37-pm.png" medium="image">
			<media:title type="html">phpinfo.php</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-25-59-am.png" medium="image">
			<media:title type="html">http://localhost/~&#60;username&#62;/phpinfo.php</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-24-12-pm.png" medium="image">
			<media:title type="html">gunzip and tar xvf xdebug</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-28-02-pm.png" medium="image">
			<media:title type="html">phpize and configure of xdebug</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-28-46-pm.png" medium="image">
			<media:title type="html">make xdebug</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-30-01-pm.png" medium="image">
			<media:title type="html">xdebug.so</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-31-56-pm.png" medium="image">
			<media:title type="html">Core and extension_dir in phpinfo.php</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-34-04-pm.png" medium="image">
			<media:title type="html">Move xdebug.so into extension_dir</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-38-36-pm.png" medium="image">
			<media:title type="html">cp php.ini.default to php.ini</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-39-49-pm.png" medium="image">
			<media:title type="html">php.ini file edited with xdebug information</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-42-11-pm.png" medium="image">
			<media:title type="html">XDebug in phpinfo.php</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-15-44-pm.png" medium="image">
			<media:title type="html">New PHP Project</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-10-30-32-am.png" medium="image">
			<media:title type="html">Activating PHP</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-46-07-pm.png" medium="image">
			<media:title type="html">TestPHPProject</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-48-31-pm.png" medium="image">
			<media:title type="html">PHP Project Configuration</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-50-33-pm.png" medium="image">
			<media:title type="html">TestPHPProject Edited Configuration</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-52-52-pm.png" medium="image">
			<media:title type="html">index.php in NetBeans with phpinfo();</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-12-at-12-55-54-pm.png" medium="image">
			<media:title type="html">NetBeans index.php file being debugged</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; Sync Directories</title>
		<link>http://devinj2ee.wordpress.com/2009/11/09/environment-consistency-sync-directories/</link>
		<comments>http://devinj2ee.wordpress.com/2009/11/09/environment-consistency-sync-directories/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 02:41:12 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Directories]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=183</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=183&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a> in regards to this subject.</p>
<p>OK, this week we&#8217;re going to sync up our directories.  There are two directories that we care about (actually 3 if you count the &#8220;NetBeansProjects&#8221; directory separately).</p>
<p>On our Windows machine, we&#8217;re already done.  We mapped in a <a title="Environment Consistency - Directories (Windows)" href="http://wp.me/pED03-F" target="_blank">previous post</a> the &#8220;\\snake\developers$&#8221; directory to our Q: drive.   This is where our third party libraries will be stored on Windows.  We also have the &#8220;My Documents&#8221; directory that resides on our Windows file server and under that directory is the &#8220;NetBeansProjects&#8221; directory.  So we&#8217;re set on the Windows side of things.</p>
<p>On the Apple Macintosh though, it&#8217;s not that easy.  We need to use a utility called rsync to sync up our Libraries directory from the file server.  The way that we do that is to first set up a rsync directory for our rsync scripts.  We do this by starting up a terminal window which will start in the ${HOME} directory and execute the command &#8220;mkdir rsync&#8221; like so:</p>
<div id="attachment_186" class="wp-caption aligncenter" style="width: 583px"><img class="size-full wp-image-186" title="mkdir rsync" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-08-at-6-25-26-pm.png" alt="mkdir rsync" width="573" height="353" /><p class="wp-caption-text">mkdir rsync</p></div>
<p>Now I&#8217;m going to create a script in that directory so I cd into it and using vi create a file called &#8220;syncLibrary.sh&#8221; like so:</p>
<div id="attachment_187" class="wp-caption aligncenter" style="width: 582px"><img class="size-full wp-image-187" title="vi syncLibrary.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-08-at-6-27-43-pm.png" alt="vi syncLibrary.sh" width="572" height="353" /><p class="wp-caption-text">vi syncLibrary.sh</p></div>
<p>We&#8217;re going to do a couple of things here.  The first thing we&#8217;re going to do is mount our Windows file server &#8220;snake&#8221;.  That is done using the mount command like so:</p>
<blockquote><p>mount -t smbfs //thcampbell:&lt;mypassword&gt;@snake.mydomain.com:/Departments /nfs/Departments</p></blockquote>
<p>This command will mount, using the smb protocol, the &#8220;Departments&#8221; directory on the Windows file server &#8220;snake.mydomain.com&#8221; using my username &#8220;thcampbell&#8221; and my password &#8220;&lt;mypassword&gt;&#8221;.  It will mount that at the &#8220;/nfs/Departments&#8221; mount point on my Apple Macintosh.  The &#8220;Departments&#8221; directory on snake.mydomain.com is a file shared created by my Windows Administrator.</p>
<p>Ok, after that&#8217;s done, I want to do my rsync.  Here&#8217;s my rsync command:</p>
<blockquote><p>rsync -auv &#8211;delete /nfs/Departments/IT/Developers/ /NetBeansLibraries</p></blockquote>
<p>This executes the rsync command with the options &#8220;-auv&#8221; and &#8220;-delete&#8221; while will sync the files from the directory &#8220;/nfs/Departments/IT/Developers&#8221; to the &#8220;/NetBeansLibraries&#8221; directory that we created in a <a title="Environment Consistency - Directories (Apple Macintosh)" href="http://wp.me/pED03-i" target="_blank">previous post</a>.</p>
<p>I&#8217;m not going to go into options &#8220;-auv&#8221; and &#8220;-delete&#8221; in detail but basically what&#8217;s going on is that the directory &#8220;/NetBeansLibraries&#8221; will be an exact duplicate of the &#8220;/nfs/Departments/IT/Developers&#8221; directory.  It will delete files and make changes to the &#8220;/NetBeansLibraries&#8221; directory each time you run it; so don&#8217;t make changes to the &#8220;/NetBeansLibrary&#8221; directory.  If a change needs to be made, make it in the &#8220;/nfs/Departments/IT/Developers&#8221; directory and then run your script &#8220;syncLibrary.sh&#8221;.</p>
<p>So after the rsync is done we have to umount our mount point by doing the following:</p>
<blockquote><p>umount /nfs/Departments</p></blockquote>
<p>Ok, so here&#8217;s what we have in our file:</p>
<div id="attachment_192" class="wp-caption aligncenter" style="width: 582px"><img class="size-full wp-image-192" title="syncLibrary.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-13-15-am.png" alt="syncLibrary.sh" width="572" height="353" /><p class="wp-caption-text">syncLibrary.sh</p></div>
<p>Save it!  And set the permissions on it to be an executable using</p>
<blockquote><p>chmod 755 syncLibrary.sh</p></blockquote>
<p>and run it</p>
<blockquote><p>./syncLibrary.sh</p></blockquote>
<div id="attachment_190" class="wp-caption aligncenter" style="width: 584px"><img class="size-full wp-image-190" title="Execute syncLibrary.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-8-55-55-am.png" alt="Execute syncLibrary.sh" width="574" height="354" /><p class="wp-caption-text">Execute syncLibrary.sh</p></div>
<p>Depending on how many changes you have to your Libraries directory this could take a while to run.  I store other things in the &#8220;/NetBeansLibraries&#8221; directory such as Software that I need (like tomcat) and some Documentation, and you can do this too if you&#8217;d like.  My third party libraries are in a sub directory called Libraries and you&#8217;ll see me reference it when I talk about managing Libraries in a later post.</p>
<p>But we&#8217;re not done yet.  We have another couple of directories we want to sync.</p>
<p>We have to rsync the &#8220;${HOME}/NetBeansProjects&#8221; directory.  This directory is where we store our projects and we&#8217;ll want to rsync it to the Windows file server so that a) we have access to it from our Windows machine and b) even though we&#8217;ll be using Subversion, it never hurts to have a backup of our projects.</p>
<p>We do pretty much the same thing as we did above.  We are going to edit a file using vi called &#8220;syncNetBeans.sh&#8221;.</p>
<p>In this file, we first mount &#8220;snake&#8221; but this time we&#8217;re mounting the &#8220;Home&#8221; directory instead of the &#8220;Departments&#8221; directory.  We&#8217;ll be mounting this directory at &#8220;/nfs/Home&#8221; on our Apple Macintosh.  Again, the &#8220;Home&#8221; directory on snake, is a share that our Windows Administrator set up for us:</p>
<blockquote><p>mount -t smbfs //thcampbell:&lt;mypassword&gt;@snake.mydomain.com:/Home /nfs/Home</p></blockquote>
<p>Next we&#8217;re going to rsync our &#8220;${HOME}/NetBeansProjects&#8221; directory to &#8220;/nfs/Home/My Documents/&#8221;.  This directory &#8220;/nfs/Home/My Documents&#8221; will correspond to the &#8220;My Documents&#8221; directory on our Windows machine so that when we use that machine, we&#8217;ll have access to our files without any effort.</p>
<blockquote><p>rsync -auv &#8211;delete /Users/thcampbell/NetBeansProjects /nfs/home/thcampbell/My\ Documents</p></blockquote>
<p>And just like before, we&#8217;re going to umount snake:</p>
<blockquote><p>umount /nfs/Home</p></blockquote>
<p>This is our finished file.</p>
<div id="attachment_194" class="wp-caption aligncenter" style="width: 585px"><img class="size-full wp-image-194" title="syncNetBeans.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-16-54-am.png" alt="syncNetBeans.sh" width="575" height="354" /><p class="wp-caption-text">syncNetBeans.sh</p></div>
<p>It&#8217;s important to note that we&#8217;re syncing <em>to</em> snake in this script instead of <em>from</em> snake like we did in the previous script.</p>
<p>Just like before, save it, chmod it and execute it.</p>
<div id="attachment_195" class="wp-caption aligncenter" style="width: 581px"><img class="size-full wp-image-195" title="Execute syncNetBeans.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-19-18-am.png" alt="Execute syncNetBeans.sh" width="571" height="354" /><p class="wp-caption-text">Execute syncNetBeans.sh</p></div>
<p>Finally I have one more directory that I want to sync.  As I&#8217;m using my Apple Macintosh as my master computer, I want to edit my files in my &#8220;${HOME}/Documents&#8221; directory but have them show up in my &#8220;My Documents&#8221; directory on my Windows machine.  So, we edit a file called &#8220;syncHome.sh&#8221; using vi.</p>
<p>Just like in the previous script, we mount &#8220;/Home&#8221; on snake to our &#8220;/nfs/Home&#8221;:</p>
<blockquote><p>mount -t smbfs //thcampbell:&lt;mypassword&gt;@snake.mydomain.com:/Home /nfs/Home</p></blockquote>
<p>Our rsync command is a little different this time though:</p>
<blockquote><p>rsync -auv &#8211;delete &#8211;exclude=NetBeansProjects /Users/thcampbell/Documents/ /nfs/home/thcampbell</p></blockquote>
<p>This time you&#8217;ll notice a &#8211;exclude=NetBeansProjects.  What this tells rsync is that it should not do anything with the &#8220;NetBeansProjects&#8221; directory.  We manage this directory using the script up above so we don&#8217;t want to mess with it here.</p>
<p>Then, just like before we umount snake:</p>
<blockquote><p>umount /nfs/Home</p></blockquote>
<p>Here&#8217;s what our finished script looks like</p>
<div id="attachment_196" class="wp-caption aligncenter" style="width: 581px"><img class="size-full wp-image-196" title="syncHome.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-30-38-am.png" alt="syncHome.sh" width="571" height="353" /><p class="wp-caption-text">syncHome.sh</p></div>
<p>Save it, chmod it and run it!</p>
<div id="attachment_198" class="wp-caption aligncenter" style="width: 582px"><img class="size-full wp-image-198" title="Execute syncHome.sh" src="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-31-48-am1.png" alt="Execute syncHome.sh" width="572" height="354" /><p class="wp-caption-text">Execute syncHome.sh</p></div>
<p>Now that you have your scripts created, you can run them by hand or you could run them using a cron job.  It&#8217;s up to you but I&#8217;ll leave figuring out how to set up cron to you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=183&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/11/09/environment-consistency-sync-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-08-at-6-25-26-pm.png" medium="image">
			<media:title type="html">mkdir rsync</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-08-at-6-27-43-pm.png" medium="image">
			<media:title type="html">vi syncLibrary.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-13-15-am.png" medium="image">
			<media:title type="html">syncLibrary.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-8-55-55-am.png" medium="image">
			<media:title type="html">Execute syncLibrary.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-16-54-am.png" medium="image">
			<media:title type="html">syncNetBeans.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-19-18-am.png" medium="image">
			<media:title type="html">Execute syncNetBeans.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-30-38-am.png" medium="image">
			<media:title type="html">syncHome.sh</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/11/screen-shot-2009-11-09-at-9-31-48-am1.png" medium="image">
			<media:title type="html">Execute syncHome.sh</media:title>
		</media:content>
	</item>
		<item>
		<title>Environment Consistency &#8211; Directories (Windows)</title>
		<link>http://devinj2ee.wordpress.com/2009/11/01/environment-consistency-directories-windows/</link>
		<comments>http://devinj2ee.wordpress.com/2009/11/01/environment-consistency-directories-windows/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 04:28:35 +0000</pubDate>
		<dc:creator>amusingponderings</dc:creator>
				<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[Directories]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://devinj2ee.wordpress.com/?p=41</guid>
		<description><![CDATA[We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=41&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.</p>
<p>This is one of several <a title="Environment Consistency" href="http://wp.me/pED03-D" target="_blank">posts</a><span class="Apple-converted-space"> </span>in regards to this subject.</p>
<p>As I mentioned, I support both a Windows environment and an Apple Mac environment and we have a different way of handling our &#8220;directories&#8221; for each environment.  We&#8217;re going to talk about Windows here.</p>
<p>There are two “directories” that are important when developing our software.  There is the “NetBeansProjects” directory and the “NetBeansLibraries” directory.</p>
<p>When NetBeans installs for Windows, it creates a directory called &#8220;NetBeansProjects&#8221; in your &#8220;My Documents&#8221; directory.  Now to keep things consistent we need to do something extra on each machine.</p>
<p>Windows has an old DOS command called SUBST which &#8220;Associates a path with a drive letter.&#8221;  Using this command we can fix it so that where ever our NetBeansProjects directory is created we can consistently associate it with the driver letter X:.  This is done by executing the following command at the command line:</p>
<p>SUBST X: &#8220;H:\My Documents\NetBeansProjects&#8221;</p>
<div id="attachment_44" class="wp-caption aligncenter" style="width: 679px"><img class="size-full wp-image-44 " title="The SUBST Command" src="http://devinj2ee.files.wordpress.com/2009/10/windows.png" alt="TheSUBST Command" width="669" height="338" /><p class="wp-caption-text">The SUBST Command</p></div>
<p>You&#8217;ll notice that my &#8220;My Documents&#8221; directory is located on the H: drive.  Fortunately for me, this directory is located on the main file server at my work place and is synchronized each time I log on to the network.  This means when I disconnect from the network, I can still work on my projects and then when I connect, everything will be backed up to the file server (which then goes to tape).  I don&#8217;t want to go into further detail about this here, talk to your System Administrator about setting this up for you.</p>
<p>If you can&#8217;t get them to create this for you, then you&#8217;ll be putting your files (probably) on your C drive somewhere.  I&#8217;ll show you in a later post how to set up Subversion to manage your source code but even then, you could have a hard drive failure and lose a couple of days of work.  Having your files synced to the file server is the best way to go.</p>
<p>Now, everyone that uses Windows, when they are using NetBeans, should create projects in X:\NetBeansProjects, NOT in H:\My Documents\NetBeansProjects.  Sounds stupid but it helps, trust me.</p>
<p>Now typing in the SUBST command each time you reboot your machine isn&#8217;t exactly my idea of fun.  So create a batch file for it (put that line in a file and save the file at c:\substx.bat) and then create a &#8220;Windows Shortcut&#8221; to c:\substx.bat in your Startup folder.  That way it&#8217;ll run each time you reboot.</p>
<p>The NetBeansLibraries directory is going to be associated with our Q: drive.  Our Windows Administrator helped us out again here by creating a special share for us called developers$.  Our file server is called &#8220;snake&#8221; so our special share is located at \\snake\developers$.  We map this drive using Windows Explorer.  So start Windows Explorer and click on Tools and then click on Map Network Drive.  A Window will come up and the information in it should look similar to the following:</p>
<div id="attachment_62" class="wp-caption aligncenter" style="width: 455px"><img class="size-full wp-image-62" title="Windows - Map Network Q Drive" src="http://devinj2ee.files.wordpress.com/2009/10/untitled.png" alt="Windows - Map Network Q Drive" width="445" height="330" /><p class="wp-caption-text">Windows - Map Network Q Drive</p></div>
<p>After you&#8217;ve done this, you need to make sure it&#8217;s going to synchronize and be available offline.  Again in Windows Explorer, right click on the Q drive and there should be an option for &#8220;Make Available Offline&#8221;.  Make sure it&#8217;s checked like so:</p>
<div id="attachment_56" class="wp-caption aligncenter" style="width: 235px"><img class="size-full wp-image-56" title="Windows - Make Available Offline" src="http://devinj2ee.files.wordpress.com/2009/10/windows4.png" alt="Windows - Make Available Offline" width="225" height="345" /><p class="wp-caption-text">Windows - Make Available Offline</p></div>
<p>If you don&#8217;t see this option go talk to your Windows Network Administrator so, he can &#8220;hook you up&#8221;.  We&#8217;ll talk about managing the Libraries in a later posts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/devinj2ee.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/devinj2ee.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/devinj2ee.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devinj2ee.wordpress.com&amp;blog=9683039&amp;post=41&amp;subd=devinj2ee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devinj2ee.wordpress.com/2009/11/01/environment-consistency-directories-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/856360ddd28d547c44d51c291ff16b39?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=X" medium="image">
			<media:title type="html">amusingponderings</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/10/windows.png" medium="image">
			<media:title type="html">The SUBST Command</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/10/untitled.png" medium="image">
			<media:title type="html">Windows - Map Network Q Drive</media:title>
		</media:content>

		<media:content url="http://devinj2ee.files.wordpress.com/2009/10/windows4.png" medium="image">
			<media:title type="html">Windows - Make Available Offline</media:title>
		</media:content>
	</item>
	</channel>
</rss>
