<?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>BenV&#039;s notes &#187; dteq</title>
	<atom:link href="http://notes.benv.junerules.com/tag/dteq/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.benv.junerules.com</link>
	<description>Rants and notes</description>
	<lastBuildDate>Sun, 29 Aug 2010 14:36:05 +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 fun</title>
		<link>http://notes.benv.junerules.com/all/software/mysql-fun/</link>
		<comments>http://notes.benv.junerules.com/all/software/mysql-fun/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:04:04 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[dteq]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=697</guid>
		<description><![CDATA[Today I was scripting up some commandline tools and found myself in need of doing some MySQL commands on the commandline. Or to be more specific: I wanted to create a database and grant some permissions. So I figured &#8220;Admin stuff&#8230; let&#8217;s try mysqladmin&#8220;. After all, mysqladmin is a &#8220;Client for Administering a MySQL Server&#8220;. [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was scripting up some commandline tools and found myself in need of doing some MySQL commands on the commandline.<br />
Or to be more specific: I wanted to create a database and grant some permissions. So I figured &#8220;Admin stuff&#8230; let&#8217;s try <span style="color:#FF00FF">mysqladmin</span>&#8220;.<span id="more-697"></span><br />
After all, mysqladmin is a &#8220;<a href="http://dev.mysql.com/doc/refman/5.1/en/mysqladmin.html">Client for Administering a MySQL Server</a>&#8220;.<br />
Well, let me tell you: <span style="color:#00FFFF">IT&#8217;S GARBAGE</span>. The retarded thing can&#8217;t even handle a <span style="color:#FFFF00">GRANT</span> statement. And everything else it does you can do with the <span style="color:#00FF77">mysql</span> tool as well, so I serously wonder why they ship this thing along with the superior mysql client.</p>
<p>Anyway, I reminded myself of a way better tool for scripting around SQL. A friend of mine wrote this and he calls it <a href="http://www.dataloss.nl/software/dteq/">dteq</a>.<br />
I&#8217;ve used it before and will probably do so again (not for grants though, mysql will do for that) in my scripts that do SQL stuff.<br />
Why? Templates! Good for auto-generating a users/passwords file and stuff like that.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">benv<span style="color: #000000; font-weight: bold;">@</span>kanker$ mysqlteq <span style="color: #ff0000;">'select * from users'</span> <span style="color: #ff0000;">':'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
benv:<span style="color: #000000;">100</span>:<span style="color: #000000;">100</span>:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>benv<br />
testuser:<span style="color: #000000;">101</span>:<span style="color: #000000;">100</span>:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">test</span></div></div>
<p>Very handy. Back to scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/mysql-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
