<?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>Web Threads &#187; mysql</title>
	<atom:link href="http://www.web-threads.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-threads.com</link>
	<description>Websites for Business and Online Communities</description>
	<lastBuildDate>Tue, 10 Aug 2010 21:48:35 +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>Drupal Query to Disable Comments on Node by Content Type</title>
		<link>http://www.web-threads.com/2010/04/drupal-query-to-disable-comments-on-node-by-content-type/</link>
		<comments>http://www.web-threads.com/2010/04/drupal-query-to-disable-comments-on-node-by-content-type/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:42:23 +0000</pubDate>
		<dc:creator>Web Threads</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[code snippet]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.web-threads.com/?p=345</guid>
		<description><![CDATA[A handy drupal snippet, when someone&#8217;s added hundreds of nodes with comments allowed and you need to bulk disable them without editing them each by hand.


UPDATE drup_node SET `comment`=0 WHERE type='review';

Modify as needed with the correct drupal node table name for your installation, and set the type= to whatever the type you&#8217;d like to update.
Like
Unlike

]]></description>
			<content:encoded><![CDATA[<p>A handy drupal snippet, when someone&#8217;s added hundreds of nodes with comments allowed and you need to bulk disable them without editing them each by hand.<br />
<span id="more-345"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> drup_node <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #008000;">`comment`</span><span style="color: #CC0099;">=</span><span style="color: #008080;">0</span> <span style="color: #990099; font-weight: bold;">WHERE</span> <span style="color: #990099; font-weight: bold;">type</span><span style="color: #CC0099;">=</span><span style="color: #008000;">'review'</span><span style="color: #000033;">;</span></pre></div></div>

<p>Modify as needed with the correct drupal node table name for your installation, and set the type= to whatever the type you&#8217;d like to update.</p>
<div class='wp_likes' id='wp_likes_post-345'><a class='like' href="javascript:wp_likes.like(345);" title='' ><img src="http://www.web-threads.com/press/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(345);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.web-threads.com/2010/04/drupal-query-to-disable-comments-on-node-by-content-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Empty Tables in PhpMyAdmin (MySQL)</title>
		<link>http://www.web-threads.com/2009/08/how-to-empty-tables-in-phpmyadmin-mysql/</link>
		<comments>http://www.web-threads.com/2009/08/how-to-empty-tables-in-phpmyadmin-mysql/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 19:58:37 +0000</pubDate>
		<dc:creator>Web Threads</dc:creator>
				<category><![CDATA[Website Management]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.web-threads.com/?p=275</guid>
		<description><![CDATA[Recently I needed to empty the Drupal sessions and cache tables which had grown to some million+ rows and were causing weekly database errors on a busy health community website. In PhpMyAdmin, permissions to empty tables weren&#8217;t available.

I searched for a quick way to easily clear the table and found that truncate does the job and the permissions to do this was there even though it was not listed in the options of phpmyadmin.

TRUNCATE TABLE `drupal_sessions`

I also added a Drupal plugin to do database maintenance weekly to prevent this happening again. Sure enough, the site has been behaving and performing much better since, knock on wood.
Like
Unlike

]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to empty the Drupal sessions and cache tables which had grown to some million+ rows and were causing weekly database errors on a busy health community website. In PhpMyAdmin, permissions to empty tables weren&#8217;t available.<br />
<span id="more-275"></span><br />
I searched for a quick way to easily clear the table and found that <a title="MySQL Manual: Truncate" href="http://dev.mysql.com/doc/refman/5.0/en/truncate.html" rel="nofollow">truncate</a> does the job and the permissions to do this was there even though it was not listed in the options of phpmyadmin.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">TRUNCATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`drupal<span style="color: #008080; font-weight: bold;">_</span>sessions`</span></pre></div></div>

<p>I also added a Drupal plugin to do database maintenance weekly to prevent this happening again. Sure enough, the site has been behaving and performing much better since, knock on wood.</p>
<div class='wp_likes' id='wp_likes_post-275'><a class='like' href="javascript:wp_likes.like(275);" title='' ><img src="http://www.web-threads.com/press/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(275);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.web-threads.com/2009/08/how-to-empty-tables-in-phpmyadmin-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

