<?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>Kieran Senior &#187; MySQL</title>
	<atom:link href="http://www.kieransenior.co.uk/category/code/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kieransenior.co.uk</link>
	<description>An Ode To Software</description>
	<lastBuildDate>Fri, 13 Aug 2010 08:10:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MySQL Can&#8217;t Connect Using Ruby On Rails Mac OS X Snow Leopard</title>
		<link>http://www.kieransenior.co.uk/2010/02/04/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/</link>
		<comments>http://www.kieransenior.co.uk/2010/02/04/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:31:13 +0000</pubDate>
		<dc:creator>Kieran</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[snowleopard]]></category>

		<guid isPermaLink="false">http://www.kieransenior.co.uk/?p=236</guid>
		<description><![CDATA[I&#39;ve spent literally a week trying to get MySQL to work with Ruby On Rails.&#160; After much hair pulling, screaming, and crying I finally figured it out.&#160; Much of this article is based on the following command: sudo gem install &#8230; <a href="http://www.kieransenior.co.uk/2010/02/04/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#39;ve spent literally a week trying to get MySQL to work with Ruby On Rails.&nbsp; After much hair pulling, screaming, and crying I finally figured it out.&nbsp; Much of this article is based on the following command:</p>
<pre class="brush:text">sudo gem install mysql &mdash; &ndash; with-mysql-config=/usr/local/mysql/bin/mysql_config</pre>
<p><strong>Install Directories Aren&#39;t All The Same<br />
	</strong></p>
<p>Contrary to the many articles out there, mysql doesn&#39;t necessarily install to the same path every time.&nbsp; The most common location for it to be installed to is /usr/local/mysql/.&nbsp; Don&#39;t take this as gospel when you see it splashed around the Intarwebs.&nbsp; In fact, your install location could well be /opt/local/var/db/mysql5/ depending on the version.&nbsp; To find out where your mysql version is simply run &quot;location mysql_config&quot; and it should narrow your search results.&nbsp; If it&#39;s the first time you&#39;ve run location then the terminal will give you command required to install it.&nbsp; So, first of all, locate the correct <em>mysql</em> location.</p>
<p><strong>Gem Install<br />
	</strong></p>
<p>Running &quot;sudo gem install mysql&quot; doesn&#39;t necessarily do what you want it to do.&nbsp; There&#39;s no real way of checking until you specify &#8211;with-mysql-config as a parameter option to the gem install.&nbsp; This will fall over and give you some error such as &quot;can&#39;t connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39;&quot;.&nbsp; Realistically this doesn&#39;t help you.&nbsp; What it really means is that you&#39;re probably pointing to the wrong path, so as the previous step mentioned, make sure you find the correct path.</p>
<p><strong>XCode<br />
	</strong></p>
<p>It&#39;s a very good idea to install the version of XCode from the Snow Leopard DVD, otherwise things won&#39;t work.&nbsp; Also, Snow Leopard supports 64-bit installs now which is another reason to use it.</p>
<p><strong>Build From Source<br />
	</strong></p>
<p>Personally I built from source.&nbsp; The last link I have provided shows how to do this.&nbsp; There&#39;s many-a-reason to do it, most of all is the flexibility.&nbsp; It will take roughly half an hour to do.</p>
<p><strong>Resources<br />
	</strong></p>
<p><a href="http://stackoverflow.com/questions/1357997/snow-leopard-ruby-1-9-1-mysql-gem-huge-problems">http://stackoverflow.com/questions/1357997/snow-leopard-ruby-1-9-1-mysql-gem-huge-problems</a></p>
<p><a href="http://stackoverflow.com/questions/1923265/installing-mysql-and-mysql-gem-on-snow-leopard">http://stackoverflow.com/questions/1923265/installing-mysql-and-mysql-gem-on-snow-leopard</a></p>
<p><a href="http://www.icoretech.org/2009/08/install-mysql-and-mysql-ruby-gem-on-snow-leopard-64-bit/">http://www.icoretech.org/2009/08/install-mysql-and-mysql-ruby-gem-on-snow-leopard-64-bit/</a> (follow this guide first)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kieransenior.co.uk/2010/02/04/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
