<?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>andr3w.net &#187; mysql</title>
	<atom:link href="http://andr3w.net/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://andr3w.net</link>
	<description>amateur web development...</description>
	<lastBuildDate>Fri, 19 Mar 2010 17:34:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>One-way MySQL DB Syncing for Dummies</title>
		<link>http://andr3w.net/2009/06/one-way-mysql-db-syncing/</link>
		<comments>http://andr3w.net/2009/06/one-way-mysql-db-syncing/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 00:05:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[system]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[syncing]]></category>

		<guid isPermaLink="false">http://andr3w.net/?p=161</guid>
		<description><![CDATA[To ease my development while on the move, I have local development copies of my websites running on my MacBook Pro. This has always worked pretty well for me, as content for my websites was created, predominantly, by myself, and when new content was created at a single site I could sync that database manually and get an up to date local content set.

With my recent efforts into lifestreaming, this is no longer the case. My content now comes in whenever I post content on any website. I'm a fairly frequent user of the internet services that feed my lifestream (twitter, delicious, flickr, etc), and keeping the content on my local version up to date was turned into a troublesome task, forcing manual, tedious syncing each time I went to work.

Without further explanation, here are the steps I took to make a one line MySQL database syncing command.]]></description>
			<content:encoded><![CDATA[<p>To ease my development while on the move, I have local development copies of my websites running on my MacBook Pro. This has always worked pretty well for me, as content for my websites was created, predominantly, by myself, and when new content was created at a single site I could sync that database manually and get an up to date local content set.</p>
<p>With my recent efforts into <a href="http://amdavidson.me">lifestreaming</a>, this is no longer the case. My content now comes in whenever I post content on <em>any</em> website. I&#8217;m a fairly frequent user of the internet services that feed my lifestream (<a href="http://twitter.com/amdavidson">Twitter</a>, <a href="http://delicious.com/amdavidson">Delicious</a>, <a href="http://flickr.com/photos/amdavidson">Flickr</a>, etc), and keeping the content on my local version up to date was turned into a troublesome task, forcing manual, tedious syncing each time I went to work.</p>
<p>Without further explanation, here are the steps I took to make a one line MySQL database syncing command. There may be better ways to do this and if you know them, please comment.</p>
<p>1. Setup a MySQL &#8220;dump&#8221; user. Mine is cleverly named &#8220;dump&#8221; and is passwordless, although if you are more security conscious than I am, you can add a password of your choosing. On the server, log into mysql and issue this GRANT statement from a user with the proper permissions.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">SELECT</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">LOCK</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #ff0000;">`dbname_remote`</span><span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'dump'</span>@<span style="color: #ff0000;">'localhost'</span>;</div></td></tr></tbody></table></div>
<p>2. Create a bash alias<br />
~/.bashrc :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ALIAS <span style="color: #007800;">clone_lifestream</span>=<span style="color: #ff0000;">'ssh -q -t hostname &quot;mysqldump -u dump dbname_remote&quot; | mysql -u root dbname_local'</span></div></td></tr></tbody></table></div>
<p><strong>Notes:</strong> For this example, you need to replace a few things.</p>
<ol>
<li>dbname = the remote database name</li>
<li>hostname = the remote hostname</li>
<li>dbname_local = the local database name</li>
<li>clone_lifestream = the name of the alias, can be anything.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://andr3w.net/2009/06/one-way-mysql-db-syncing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql Gem + MacPorts MySQL</title>
		<link>http://andr3w.net/2009/01/mysql-gem-macports-mysql/</link>
		<comments>http://andr3w.net/2009/01/mysql-gem-macports-mysql/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 01:24:28 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://andr3w.net/?p=24</guid>
		<description><![CDATA[I always forget this&#8230; so this is as much a note for me as anything else.
Especially because I&#8217;m basically just lifting this info from here.
1234sudo gem install mysql -- \
--with-mysql-include=/opt/local/include/mysql5 \
--with-mysql-lib=/opt/local/lib/mysql5 \
--with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
Despite what the linked website says, it appears that this command works on leopard just fine&#8230; no need for any changes.
]]></description>
			<content:encoded><![CDATA[<p>I always forget this&#8230; so this is as much a note for me as anything else.</p>
<p>Especially because I&#8217;m basically just lifting this info from <a href="http://codeintensity.blogspot.com/2007/09/installing-ruby-mysql-gem-with-macports.html">here</a>.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql <span style="color: #660033;">--</span> \<br />
<span style="color: #660033;">--with-mysql-include</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mysql5 \<br />
<span style="color: #660033;">--with-mysql-lib</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql5 \<br />
<span style="color: #660033;">--with-mysql-config</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql5<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config</div></td></tr></tbody></table></div>
<p>Despite what the linked website says, it appears that this command works on leopard just fine&#8230; no need for any changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://andr3w.net/2009/01/mysql-gem-macports-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
