<!-- move these styles into a global definition -->

<style>
.hint {
	color: #ccc;
}

.sparkInput {
	font-size: 12px;
	padding: 5px;
	color: #222222;
	width: 500px;
	font-family: "Lucida Grande",verdana,arial,helvetica,sans-serif;
}

.sparkTextarea {
	width: 500px;
	height: 250px;
	font-size: 14px;
	padding: 3px;
	color: #222222;
	font-family: "Lucida Grande",verdana,arial,helvetica,sans-serif;
}

.sparkButton {
	font-size: 12px;
	padding: 5px;
	color: #222222;
	font-family: "Lucida Grande",verdana,arial,helvetica,sans-serif;
}

.required {
	color: red;
}

</style>

<script>
function toggleEndDate()
{
	if(	document.getElementById('endDateRow').style.display == 'none')
		document.getElementById('endDateRow').style.display = 'block';
	else
		document.getElementById('endDateRow').style.display = 'none';
}

function showNewVenue()
{
	document.getElementById('newVenue').style.display = 'block';
	document.getElementById('venueList').style.display = 'none';
	
}

function showNewLocation()
{
	document.getElementById('event_location_dropdown').style.display = 'none';
	document.getElementById('event_location_new').style.display = 'block';
	
}

</script>


<style>
	.sparkInput {
		width: 250px;
	}

</style>

<script>

function showNewLocation()
{
	document.getElementById('venue_location_dropdown').style.display = 'none';
	document.getElementById('venue_location_new').style.display = 'block';
	
}

</script>

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

<channel>
	<title>Colin Loretz &#187; mac osx</title>
	<atom:link href="http://colinloretz.com/tag/mac-osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://colinloretz.com</link>
	<description>Technology &#38; Life Hacking</description>
	<lastBuildDate>Mon, 23 Aug 2010 20:22:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installing MySQL from source on Mac OS X Leopard</title>
		<link>http://colinloretz.com/2008/09/install-mysql-from-source-on-mac-os-x/</link>
		<comments>http://colinloretz.com/2008/09/install-mysql-from-source-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 18:08:45 +0000</pubDate>
		<dc:creator>Colin Loretz</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://colinloretz.com/?p=64</guid>
		<description><![CDATA[I spent a few hours going through these steps with a friend of mine, Glenn, who is starting to learn Ruby on Rails. He wanted to install MySQL so we decided to do it from source. Glenn was trying to install MySQL using Dan Benjamin&#8217;s tutorial at Hivelogic. I found the same steps that Dan [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a few hours going through these steps with a friend of mine, <a href="http://www.twitter.com/iamglenn" onclick="pageTracker._trackPageview('/outgoing/www.twitter.com/iamglenn?referer=');">Glenn</a>, who is starting to learn Ruby on Rails. He wanted to install MySQL so we decided to do it from source. Glenn was trying to install MySQL using Dan Benjamin&#8217;s tutorial at <a href="http://hivelogic.com/articles/2007/11/installing-mysql-on-mac-os-x" onclick="pageTracker._trackPageview('/outgoing/hivelogic.com/articles/2007/11/installing-mysql-on-mac-os-x?referer=');">Hivelogic</a>. I found the same steps that Dan posted on a few other websites but the remote source code his example tries to download no longer exists. This process does not take a few hours but we ran into a few issues trying to find a working copy of the version we used: <code>mysql-5.0.45.tar.gz</code>.</p>
<p>This is a quick post, which I hope may help anyone else trying to install MySQL, but I have not gone in depth on any of the steps. If you have any issues or questions, please feel free to comment below.</p>
<p>Disable any existing installs of MySQL:<br />
<code>sudo rm /usr/local/mysql</code></p>
<p>Remove the startup item:<br />
<code>sudo rm -rf /Library/StartupItems/MySQLCOM/</code></p>
<p>Setup your path by editing your .bash_login file, I&#8217;ll be using Textmate:<br />
<code>mate ~/.bash_login</code></p>
<p>Add to the end of the file:<br />
<code>export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"</code></p>
<p>Save the file.</p>
<p>Create a directory called <code>src</code> in your home folder.<br />
<code>mkdir src</code><br />
<code>cd src</code></p>
<p>To download the mysql source:<br />
<code>curl -O http://mirror.provenscaling.com/mysql/community/source/5.0/mysql-5.0.45.tar.gz</code></p>
<p>Extrace the code from the gzip and enter the directory:<br />
<code>tar xzvf mysql-5.0.45.tar.gz</code><br />
<code>cd mysql-5.0.45</code></p>
<p>You now need to configure MySQL, paste the following into Terminal and press enter:<br />
<code>CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc \<br />
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \<br />
-fno-exceptions -fno-rtti" \<br />
./configure --prefix=/usr/local/mysql \<br />
--with-extra-charsets=complex --enable-thread-safe-client \<br />
--enable-local-infile --enable-shared</code></p>
<p>Now we will compile the code:<br />
<code>make</code></p>
<p>And install the code:<br />
<code>sudo make install</code></p>
<p>The last two steps may take a while.</p>
<p>Once all of this is complete, it&#8217;s time to setup the initial database user and privileges.<br />
<code>cd /usr/local/mysql<br />
sudo ./bin/mysql_install_db --user=mysql<br />
sudo chown -R mysql ./var</code></p>
<p>Now MySQL should be installed. In order to start the initial MySQL and have it start every time you restart your machine, do the following:</p>
<p>Create a file in /Library/LaunchDaemons named <code>com.mysql.mysqld.plist</code><br />
Paste the following XML into the new file:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.mysql.mysqld&lt;/string&gt;
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;/usr/local/mysql/bin/mysqld_safe&lt;/string&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;UserName&lt;/key&gt;
    &lt;string&gt;mysql&lt;/string&gt;
    &lt;key&gt;WorkingDirectory&lt;/key&gt;
    &lt;string&gt;/usr/local/mysql&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p>While still in the LaunchDaemons folder, enter:<br />
<code><span style="text-decoration: line-through;">sudo chown root /com.mysql.mysqld.plist</span><br />
sudo chown root com.mysql.mysqld.plist </code></p>
<p>Return to the top directory and enter:<br />
<code>sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist</code></p>
<p>MySQL should now be running. To enter MySQL, enter in Terminal:<br />
<code>mysql -u root</code></p>
<p>You should see the following:<br />
<code>Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 1<br />
Server version: 5.0.45 Source distribution<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br />
mysql&gt;</code></p>
<p>Congratulations, you&#8217;ve installed MySQL from binary source!</p>
<p>If you do not see the MySQL monitor, make sure you followed all the steps above. When I did this for the first time, it didn&#8217;t work so I disabled the install and started over from the top and it worked fine the second time around.</p>
]]></content:encoded>
			<wfw:commentRss>http://colinloretz.com/2008/09/install-mysql-from-source-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
