<?xml version="1.0" encoding="UTF-8"?>

<rss version='2.0' 
     xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
     xmlns:doap="http://usefulinc.com/ns/doap#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <channel>
        <!-- This XML Feed shows details for the page mysqlproxy 
             and everything recently tagged mysqlproxy -->
        <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/
          </creativeCommons:license>
        <title>mysqlproxy on SWiK</title>
        <doap:name>mysqlproxy</doap:name>
        <doap:description></doap:description>
        <description></description> 
	  <!-- see doap:description for full description -->
        <link>http://swik.net/mysqlproxy</link>
        <doap:homepage></doap:homepage>
        
        <pubDate></pubDate>
        <lastBuildDate></lastBuildDate>
            
        <item>
            <title>Suspekt... &quot; Blog Archive &quot; MySQL-Proxy learning to block SQL-Injection</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/Suspekt...+%22+Blog+Archive+%22+MySQL-Proxy+learning+to+block+SQL-Injection/ccvsq</link>
            <description></description>
            
            <pubDate>Tue, 19 Aug 2008 03:21:59 -0700</pubDate>
        </item>
            
        <item>
            <title>MySQL :: MySQL 5.0 Reference Manual :: 16.4.2 Internal Structures</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/MySQL+%3A%3A+MySQL+5.0+Reference+Manual+%3A%3A+16.4.2+Internal+Structures/ccizz</link>
            <description></description>
            
            <pubDate>Thu, 14 Aug 2008 17:09:18 -0700</pubDate>
        </item>
            
        <item>
            <title>lua-users wiki: Making Lua Like Php</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/lua-users+wiki%3A+Making+Lua+Like+Php/ccizy</link>
            <description></description>
            
            <pubDate>Thu, 14 Aug 2008 17:09:18 -0700</pubDate>
        </item>
            
        <item>
            <title>Search :: Search the Forge</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/Search+%3A%3A+Search+the+Forge/ccizx</link>
            <description></description>
            
            <pubDate>Thu, 14 Aug 2008 17:09:18 -0700</pubDate>
        </item>
            
        <item>
            <title>O&#039;Reilly Network -- Getting Started with MySQL Proxy</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/O%27Reilly+Network+--+Getting+Started+with+MySQL+Proxy/cbydj</link>
            <description></description>
            
            <pubDate>Fri, 08 Aug 2008 09:07:59 -0700</pubDate>
        </item>
            
        <item>
            <title>~jk MySQL Proxy learns R/W Splitting</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/%7Ejk+MySQL+Proxy+learns+R%2FW+Splitting/b7rzh</link>
            <description></description>
            
            <pubDate>Wed, 18 Jun 2008 08:17:46 -0700</pubDate>
        </item>
            
        <item>
            <title>Most Commonly Sought-After Command in MySQL Proxy</title>
            <link>http://swik.net/MySQL/Planet+MySQL/Most+Commonly+Sought-After+Command+in+MySQL+Proxy/b49b4</link>
            <description>&lt;p&gt;One of the most frequently needed functionality in the MySQL Proxy is the need to know which server you are on.  This is not given, on purpose, by the proxy, because the proxy is supposed to be transparent.  It is not supposed to matter which back-end server you are on.&lt;/p&gt;
&lt;p&gt;However, for testing purposes we often want to know which back-end server we&amp;#8217;re on.  Thus I developed functionality for &lt;code&gt;SHOW PROXY BACKEND [INDEX ADDRESS OTHER]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SHOW PROXY BACKEND INDEX&lt;/code&gt; &amp;#8212; gives the index of the server you&amp;#8217;re on (backend_ndx, ie 1)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SHOW PROXY BACKEND ADDRESS&lt;/code&gt; &amp;#8212; gives the address of the server you&amp;#8217;re on (ie, foo.bar.com:3306)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SHOW PROXY BACKEND OTHER&lt;/code&gt; &amp;#8212; gives the address of all the other servers except those you&amp;#8217;re not on, in multiline format.&lt;/p&gt;
&lt;p&gt;Note that I was pretty lazy and the commands are case-sensitive.  But I figured that since this is supposed to be used mostly in testing circumstances, it did not really matter.&lt;/p&gt;
&lt;p&gt;The code is on the MySQL Forge Wiki at &lt;A HREF=&quot;http://forge.mysql.com/tools/tool.php?id=139&quot;&gt;http://forge.mysql.com/tools/tool.php?id=139&lt;/A&gt;&lt;/p&gt;
&lt;p&gt;Interestingly enough, this script is actually being used in production &amp;#8212; a site has a primary and failover server, and wants to check that when the primary server is in use, there are &lt;em&gt;no&lt;/em&gt; connections on the failover.  I wrote that check as well, but as the logic is somewhat particular, I am not sure it would be useful to many.  The logic is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;SHOW PROXY BACKEND INDEX&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;if it fails, I can&amp;#8217;t connect to the proxy, log an error, exit.&lt;/li&gt;
&lt;li&gt;if it !=1, I&amp;#8217;m on the failover server, log a warning, exit.&lt;/li&gt;
&lt;li&gt;if it =1, I&amp;#8217;m on the primary server.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;SHOW PROXY BACKEND OTHER&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;if it is empty, either I can&amp;#8217;t connect to the proxy or there are no failovers defined, log a warning, exit&lt;/li&gt;
&lt;li&gt;For each &lt;code&gt;OTHER&lt;/code&gt; address, connect to them and find what that connection&amp;#8217;s host looks like (sometimes it looks like &lt;code&gt;foo.bar.com:4325&lt;/code&gt;, other times it looks like &lt;code&gt;1.2.3.4:4573&lt;/code&gt;).  Get the value of &amp;#8220;my host&amp;#8221; by stripping off the port.&lt;/li&gt;
&lt;li&gt;Connect to the &lt;code&gt;OTHER&lt;/code&gt; address again, killing off connections from &amp;#8220;my host&amp;#8221; except for the &amp;#8220;system user&amp;#8221; and a few other special accounts (replication slave being one of them).  Log each kill with the thread number and a warning.&lt;/li&gt;
&lt;li&gt;If there are no connections to be killed, log OK.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let me know if you&amp;#8217;d like to see that&amp;#8230;it&amp;#8217;s a shell script, and it requires the mysql client and bintools like &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;cut&lt;/code&gt;.&lt;/p&gt;</description>
            
            <pubDate>Sat, 17 May 2008 09:14:48 -0700</pubDate>
        </item>
            
        <item>
            <title>Fun with MySQL Proxy</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/Fun+with+MySQL+Proxy/bt5hc</link>
            <description></description>
            
            <pubDate>Thu, 15 Nov 2007 11:47:53 -0800</pubDate>
        </item>
            
        <item>
            <title>~jk MySQL Proxy learns R/W Splitting</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/%7Ejk+MySQL+Proxy+learns+R%2FW+Splitting/bqt7w</link>
            <description></description>
            
            <pubDate>Wed, 17 Oct 2007 14:59:51 -0700</pubDate>
        </item>
            
        <item>
            <title>~jk MySQL Proxy learns R/W Splitting</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/%7Ejk+MySQL+Proxy+learns+R%2FW+Splitting/bqs5r</link>
            <description>MySQL Proxy learns R/W Splitting</description>
            
            <pubDate>Wed, 17 Oct 2007 13:31:24 -0700</pubDate>
        </item>
            
        <item>
            <title>~jk MySQL Proxy learns R/W Splitting</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/%7Ejk+MySQL+Proxy+learns+R%2FW+Splitting/biop4</link>
            <description>Using mysql-proxy and Lua to split read/writes between master/slave DB nodes.</description>
            
            <pubDate>Sun, 12 Aug 2007 18:25:50 -0700</pubDate>
        </item>
            
        <item>
            <title>MySQL Proxy - MySQLForge Wiki</title>
            <link>http://swik.net/opensource/del.icio.us+tag%2Fopensource/MySQL+Proxy+-+MySQLForge+Wiki/bg7r8</link>
            <description></description>
            
            <pubDate>Wed, 01 Aug 2007 23:26:28 -0700</pubDate>
        </item>
            
        <item>
            <title>MySQL Proxy - MySQLForge Wiki</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/MySQL+Proxy+-+MySQLForge+Wiki/bewyu</link>
            <description>A simple program that sits between your client and MySQL server(s) that can monitor, analyze or transform their communication.</description>
            
            <pubDate>Tue, 17 Jul 2007 22:29:35 -0700</pubDate>
        </item>
            
        <item>
            <title>LuaSQL: Database connectivity for the Lua programming language</title>
            <link>http://swik.net/Lua/del.icio.us%2Ftag%2Flua/LuaSQL%3A+Database+connectivity+for+the+Lua+programming+language/bc2ug</link>
            <description></description>
            
            <pubDate>Wed, 27 Jun 2007 05:58:12 -0700</pubDate>
        </item>
                </channel>
</rss>
