<?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>Geekality &#187; MySql</title>
	<atom:link href="http://www.geekality.net/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekality.net</link>
	<description>With a hint of Social Ineptitude</description>
	<lastBuildDate>Tue, 27 Jul 2010 16:15:56 +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>How to delete WordPress post revisions</title>
		<link>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/</link>
		<comments>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 21:40:23 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Sql]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=689</guid>
		<description><![CDATA[Having revisions on my posts is nice I suppose. But I was starting to get a bit annoyed with the increasingly long list of revisions in each post. And they really did get long. Mainly because I am in a &#8230; <a href="http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having revisions on my posts is nice I suppose. But I was starting to get a bit annoyed with the increasingly long list of revisions in each post. And they really did get long. Mainly because I am in a bit of a testing and experimenting phase which means that I have done a lost of adjustments to almost every single post so far because I don&#8217;t have 100% control on how I want things or how things will end up looking and so on <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' title=':P' class='wp-smiley smiley-13' /> </p>
<p>Anyways, I found a nice little MySQL snippet to clear out all of them in a French comment to <a href="http://www.mydigitallife.info/2008/07/22/how-to-delete-existing-wordpress-post-revisions-storedsaved/">a blog post</a>. Thought I could share it here. Especially since I then know where to find it and it won&#8217;t disappear on me.</p>
<p><span id="more-689"></span></p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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;">DELETE</span> x<span style="color: #66cc66;">,</span>y<span style="color: #66cc66;">,</span>z<br />
<span style="color: #993333; font-weight: bold;">FROM</span> wp_63nbis_posts x<br />
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wp_63nbis_term_relationships y <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span>x<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> y<span style="color: #66cc66;">.</span>object_id<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wp_63nbis_postmeta z <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span>x<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> z<span style="color: #66cc66;">.</span>post_id<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">WHERE</span> x<span style="color: #66cc66;">.</span>post_type <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'revision'</span></div></div>
<p>I did a select first (just swap <code class="codecolorer text default"><span class="text">delete x,y,z</span></code> with <code class="codecolorer text default"><span class="text">select *</span></code>) to check that it would delete what it was actually supposed to. And then a delete inside a transaction with another select afterwards, just in case <img src='http://www.geekality.net/wp-includes/images/blank.gif' alt=':P' title=':P' class='wp-smiley smiley-13' /> (All of which are very easy to do in <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL Query Browser</a>)</p>
<p>By the way, in the comments to that mentioned blog post there are also mentioned some other solutions to this problem. For example:</p>
<ul>
<li>Adding <code class="codecolorer php default"><span class="php"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> N<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></code> to your wp-config.php file, where N would be the maximum number of revisions you want to allow, or -1 if you want them all.</li>
<li>Add a plugin to WordPress called <a href="http://www.zauberpage.de/wordpress-plugin-revision-delete-english.html">revision delete!</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2009/10/20/how-to-delete-wordpress-post-revisions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to reset the MySql root account</title>
		<link>http://www.geekality.net/2008/12/27/how-to-reset-the-mysql-root-account/</link>
		<comments>http://www.geekality.net/2008/12/27/how-to-reset-the-mysql-root-account/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 16:38:24 +0000</pubDate>
		<dc:creator>Torleif</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.geekality.net/?p=55</guid>
		<description><![CDATA[I just managed to mess up the MySQL root account. Not a smart idea. After some MySQL manual reading and some serious Google-Fu, I figured out how to fix it. Stop the mysql server Add the following to the my.cnf &#8230; <a href="http://www.geekality.net/2008/12/27/how-to-reset-the-mysql-root-account/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just managed to mess up the MySQL root account. Not a smart idea. After some MySQL manual reading and some serious Google-Fu, I figured out how to fix it.</p>
<ol>
<li>Stop the mysql server</li>
<li>Add the following to the my.cnf file
<div class="codecolorer-container ini default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ini codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>mysqld<span style="">&#93;</span></span><br />
skip-grant-tables</div></div>
</li>
<li>Start the mysql server</li>
<li>Start a mysql client and run the following query
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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;">REPLACE</span> <span style="color: #993333; font-weight: bold;">INTO</span> mysql<span style="color: #66cc66;">.</span>user <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'localhost'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'root'</span><span style="color: #66cc66;">,</span>PASSWORD<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'blah'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</div></div>
</li>
<li>Quit the mysql client</li>
<li>Stop the mysql server</li>
<li>Remove what we added to my.cnf in step 2</li>
<li>Restart the mysql server</li>
</ol>
<p>Tadaa.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekality.net/2008/12/27/how-to-reset-the-mysql-root-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
