<?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>I swore I wouldn&#039;t &#187; mysql</title>
	<atom:link href="http://www.wontblog.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wontblog.com</link>
	<description>Oh no, I&#039;m blogging now?</description>
	<lastBuildDate>Wed, 23 Feb 2011 20:06:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing MySQL gem on OS X</title>
		<link>http://www.wontblog.com/2010/04/26/installing-mysql-gem-on-os-x/</link>
		<comments>http://www.wontblog.com/2010/04/26/installing-mysql-gem-on-os-x/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 15:49:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Host]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.wontblog.com/?p=54</guid>
		<description><![CDATA[I encountered the following error when installing the mysql gem on a shiny new Macbook Pro running OS X Leopard. Note: I have ~/.gem set as my GEM_HOME and GEM_PATH to avoid needing to sudo &#62; gem install mysql Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build [...]]]></description>
			<content:encoded><![CDATA[<p><!--digg--><br />
<img class="alignleft" title="RoR" src="http://img.skitch.com/20100426-mugukqdh7hp8fhhy6t476u3ued.png" alt="" width="173" height="178" />I encountered the following error when installing the mysql gem on a shiny new Macbook Pro running OS X Leopard.</p>
<p><em>Note: I have ~/.gem set as my GEM_HOME and GEM_PATH to avoid needing to sudo</em></p>
<p><code><br />
&gt;  gem install mysql<br />
Building native extensions.  This could take a while...<br />
ERROR:  Error installing mysql:<br />
ERROR: Failed to build gem native extension.</code></p>
<p><code>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb<br />
checking for mysql_query() in -lmysqlclient... no<br />
checking for main() in -lm... yes<br />
checking for mysql_query() in -lmysqlclient... no<br />
checking for main() in -lz... yes<br />
checking for mysql_query() in -lmysqlclient... no<br />
checking for main() in -lsocket... no<br />
checking for mysql_query() in -lmysqlclient... no<br />
checking for main() in -lnsl... no<br />
checking for mysql_query() in -lmysqlclient... no<br />
checking for main() in -lmygcc... no<br />
checking for mysql_query() in -lmysqlclient... no<br />
*** extconf.rb failed ***<br />
Could not create Makefile due to some reason, probably lack of<br />
necessary libraries and/or headers.  Check the mkmf.log file for more<br />
details.  You may need configuration options.<br />
</code></p>
<p>The workaround was fairly simple.  Since I had <a href="http://www.wontblog.com/2010/04/19/installing-mysql-from-source-on-os-x/">installed MySQL from source</a> the situation was resolved with a few command line options:</p>
<p><code><br />
&gt; export ARCHFLAGS="-arch x86_64"<br />
&gt; gem install mysql -- \<br />
--with-mysql-dir=/usr/local/mysql \<br />
--with-mysql-lib=/usr/local/mysql/lib \<br />
--with-mysql-include=/usr/local/mysql/include \<br />
--with-mysql-config=/usr/local/mysql/bin/mysql_config </code></p>
<p><code> </code></p>
<p><code>Building native extensions.  This could take a while...<br />
Successfully installed mysql-2.8.1<br />
1 gem installed<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wontblog.com/2010/04/26/installing-mysql-gem-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL from source on OS X</title>
		<link>http://www.wontblog.com/2010/04/19/installing-mysql-from-source-on-os-x/</link>
		<comments>http://www.wontblog.com/2010/04/19/installing-mysql-from-source-on-os-x/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 18:38:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Host]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.wontblog.com/?p=42</guid>
		<description><![CDATA[While MAMP has proven to be very convenient for doing local development, not having the MySQL header files around sometimes causes difficulty when it comes time to install/compile something that needs those header files to be in place. Getting Ready I always set up a src directory under my user account for these installations. &#62; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="MySQL on OS X" src="http://img.skitch.com/20100419-crtd938d279aqnig138thifa8x.png" alt="" width="256" height="256" />While <a href="http://www.mamp.info/" target="_blank">MAMP</a> has proven to be very convenient for doing local development, not having the MySQL header files around sometimes causes difficulty when it comes time to install/compile something that needs those header files to be in place.</p>
<p><strong>Getting Ready</strong><br />
I always set up a src directory under my user account for these installations.<br />
<code><br />
&gt; cd ~<br />
&gt; mkdir src<br />
&gt; cd src<br />
</code></p>
<p><strong><span style="font-weight: normal;"> </span> </strong></p>
<p><strong>Download MySQL Community Edition</strong><br />
At the time of this writing, it could be found at http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.1/mysql-5.1.45.tar.gz</p>
<p>Download this file into your src directory.<br />
<code><br />
&gt; curl -O http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.1/mysql-5.1.45.tar.gz<br />
</code></p>
<p><strong>Untar, configure, and install</strong><br />
<code><br />
&gt; tar -xvzf mysql-5.1.45.tar.gz<br />
&gt; cd mysql-5.1.45<br />
&gt; ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \<br />
--enable-thread-safe-client --enable-local-infile --enable-shared \<br />
--with-plugins=innobase</code></p>
<p><code>&gt; make<br />
&gt; sudo make install</code></p>
<p><code> </code></p>
<p><code>&gt; cd /usr/local/mysql<br />
&gt; sudo ./bin/mysql_install_db --user=mysql<br />
&gt; sudo chown -R mysql ./var<br />
&gt; cd ..<br />
</code></p>
<p><em>MAMP specific issue</em></p>
<p>Given that I had installed MAMP previously, I had modified my /etc/my.cnf to specify that the mysql.sock was located in /Applications/MAMP/tmp/mysql/mysql.sock.  I modified this line to point to /usr/local/mysql/var/mysql.sock, and then set the sticky bit on the var directory.<br />
<code><br />
&gt; chmod 1777 /usr/local/mysql/var<br />
</code></p>
<p>There are other steps that can be added so that mysqld launches on startup, but I prefer to start it manually when it is needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wontblog.com/2010/04/19/installing-mysql-from-source-on-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing django with MySQL on OS X</title>
		<link>http://www.wontblog.com/2010/04/16/installing-django-on-os-x/</link>
		<comments>http://www.wontblog.com/2010/04/16/installing-django-on-os-x/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:16:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Host]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.wontblog.com/?p=39</guid>
		<description><![CDATA[I am experimenting with the django web-framework for a few projects at work.  I do the majority of my work in PHP or Java, but occasionally I like to play with Ruby on Rails, and decided that django deserved to have a look as well. The first step in this process is to get django [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Installing django" src="http://img.skitch.com/20100416-qs9itxb2iftngkeduru395cm6g.png" alt="" width="279" height="211" /></p>
<p>I am experimenting with the django web-framework for a few projects at work.  I do the majority of my work in PHP or Java, but occasionally I like to play with Ruby on Rails, and decided that django deserved to have a look as well.</p>
<p>The first step in this process is to get django and the various components installed.</p>
<ul>
<li>Python</li>
<li>EasyTools</li>
<li>MySql</li>
<li>MySqlDB</li>
<li>Django</li>
</ul>
<p><strong><span id="more-39"></span>Python</strong> &#8211; I do my development from a relatively new Macbook Pro, and as such, Python 2.6.1 is already installed.  This is confirmed by typing &#8216;python&#8217; from a terminal window.</p>
<blockquote><p>&gt; python</p>
<div id="_mcePaste">Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)</div>
<div id="_mcePaste">[GCC 4.2.1 (Apple Inc. build 5646)] on darwin</div>
<div id="_mcePaste">Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.</div>
<div id="_mcePaste">&gt;&gt;&gt; ^D</div>
</blockquote>
<p><strong>EasyTools</strong> &#8211; Download the OS X of setup tools from <a href="http://pypi.python.org/pypi/setuptools#files">http://pypi.python.org/pypi/setuptools#files</a>, then run the .egg file as if it were an executable:</p>
<blockquote><p>sh setuptools-0.6c9-py2.4.egg</p></blockquote>
<p><strong>MySql </strong>- <span style="text-decoration: line-through;">I use MAMP (</span><a href="http://www.mamp.info" target="_blank"><span style="text-decoration: line-through;">http://www.mamp.info</span></a><span style="text-decoration: line-through;">) for my local PHP development (not sure how anybody could live without MAMP running locally.) MAMP provides a drop-in MySQL installation that I use for all of my local development purposes.  The one caveat to this is that it is not uncommon to run into scenarios where something is looking for a mysql_* executable that isn&#8217;t being found in the default location.</span></p>
<p>I previously was using MAMP for these installations, but found that at times, header files were needed for other installations, and MAMP isn&#8217;t really intended for this type of usage.  I still think MAMP is a great tool, but in this case, I needed to <a href="http://www.wontblog.com/2010/04/19/installing-mysql-from-source-on-os-x/" target="_blank">Install Mysql from source</a>.</p>
<p>Next, add the path to the mysql_* executables to your PATH.</p>
<blockquote><p>&gt; export PATH=/usr/local/mysql/bin:$PATH</p></blockquote>
<p><strong>MySqlDB</strong> &#8211; In order for python/django to be able to talk with MySQL, the MySQL DB driver needs to be installed.  This is an area that caused me a little bit of delay, as the installation of MySQL-python 1.2.3c1 was complaining about my lack of gcc.  I encountered a few posts that described how to get around this limitation with earlier versions of MySQL-python, but given that I do a lot of development, it felt like the right thing to do would be to install the Mac OSX Developer Tools.</p>
<blockquote><p>&gt; curl -O http://pypi.python.org/packages/2.6/M/MySQL-python/MySQL_python-1.2.3c1-py2.6-linux-i686.egg<br />
&gt; sudo easy_install MySQL_python-1.2.3c1-py2.6-linux-i686.egg</p></blockquote>
<p>If you receive errors about mysql, or gcc, then you need to re-visit your environment setup.</p>
<p><strong>Django</strong> &#8211; Once these pieces were in place, installing the actual django source code was trivial.</p>
<blockquote><p>&gt; svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk</p></blockquote>
<p>Next, make sure that the Python interpreter can load Django&#8217;s code. There are various ways of accomplishing this. One of the most convenient, on Linux, Mac OSX or other Unix-like systems, is to use a symbolic link:</p>
<blockquote><p>&gt; ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django</p></blockquote>
<p><em>Finding SITE-PACKAGES-DIR</em> -<br />
To find the location of the SITE-PACKAGES-DIR on your system, execute the following command from the command line:</p>
<blockquote><p>&gt; python -c &#8220;from distutils.sysconfig import get_python_lib; print get_python_lib()&#8221;</p></blockquote>
<p><strong>Add Django commands to PATH</strong> &#8211; I find it helpful to add the django bin directory to my PATH environment variable so that I have convenient access to the framework&#8217;s various commands:</p>
<blockquote><p>&gt; export PATH=SITE-PACKAGES-DIR/django/bin:$PATH</p></blockquote>
<p><strong>Earn $$$</strong> &#8211; Now that these pieces are in place, you can create your first django project by issuing the command:</p>
<blockquote><p>&gt; django-admin.py startproject mysite</p></blockquote>
<p>Overall the installation was a snap, on par with a Ruby on Rails installation.  Over the next few weeks, I will start developing some simple django projects and write a post describing the experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wontblog.com/2010/04/16/installing-django-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

