<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - MySQL Proxy</title>
        <description>Forum for MySQL Proxy</description>
        <link>http://forums.mysql.com/list.php?146</link>
        <lastBuildDate>Tue, 24 Nov 2009 20:30:36 +0000</lastBuildDate>
        <generator>Phorum 5.2.1-alpha</generator>
        <item>
            <guid>http://forums.mysql.com/read.php?146,292612,292612#msg-292612</guid>
            <title>i want to write lua script for mysql-proxy,but how can i know the data struct of mysql-proxy? (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,292612,292612#msg-292612</link>
            <description><![CDATA[ for instance,proxy.global.backends,i want to know what is it,where i can get the doc like this?]]></description>
            <dc:creator>h ch</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Tue, 24 Nov 2009 07:06:34 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,292587,292587#msg-292587</guid>
            <title>MySQL Proxy: Improved read-only load balancing (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,292587,292587#msg-292587</link>
            <description><![CDATA[ MySQL Proxy: Improved read-only load balancing <br />
<a rel="nofollow"  href="http://blogs.sun.com/soapbox/entry/improved_read_only_load_balancing">http://blogs.sun.com/soapbox/entry/improved_read_only_load_balancing</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Tue, 24 Nov 2009 04:21:51 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,292410,292410#msg-292410</guid>
            <title>have problem in use mysql-proxy admin (4 replies)</title>
            <link>http://forums.mysql.com/read.php?146,292410,292410#msg-292410</link>
            <description><![CDATA[ i installed lua ，and download mysql-proxy-0.7.2-linux-rhel5-x86-32bit.tar.gz<br />
cp mysql-proxy to /usr/local,and i start mysql-proxy with follow command<br />
<br />
mysql-proxy --proxy-read-only-backend-addresses=172.16.20.210:3306 --proxy-backend-addresses=172.16.1.19:3306 --admin-username=root --admin-password=12345 --admin-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua --proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua &gt; /var/log/mysql-proxy/mysql-proxy.log &amp;<br />
<br />
and /usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua is the lua script that i download from <a rel="nofollow"  href="http://forge.mysql.com/tools/tool.php?id=198">http://forge.mysql.com/tools/tool.php?id=198</a> and when i login in the admin port use <br />
<br />
mysql -uroot -p -h172.16.1.19 -P4041<br />
Enter password: 12345<br />
and still have problem in query<br />
<br />
Your MySQL connection id is 1<br />
Server version: 5.0.99-agent-admin<br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br />
<br />
mysql&gt; select * from backends;<br />
ERROR 2006 (HY000): MySQL server has gone away<br />
No connection. Trying to reconnect...<br />
Connection id:    1<br />
Current database: *** NONE ***<br />
<br />
ERROR 1105 (07000): need a resultset + proxy.PROXY_SEND_RESULT<br />
<br />
why?,seems lack something]]></description>
            <dc:creator>h ch</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Tue, 24 Nov 2009 03:23:45 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,291572,291572#msg-291572</guid>
            <title>Get asked database to switch backend (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,291572,291572#msg-291572</link>
            <description><![CDATA[ Hi,<br />
<br />
I have 2 mysql server on 2 different machines. My aim, is to use mysql-proxy to switch server depending on the wanted database.  <br />
<br />
For example : <br />
<br />
Mysql-proxy is running on the first server with mysql server 1<br />
<br />
databaseX is on mysql server 1<br />
databaseY is on mysql server 2<br />
<br />
<br />
If I ask databaseX (through mysql-proxy) I want to use server 1, and if I ask databaseY (through mysql-proxy) I want to use server 2.<br />
<br />
Could this be possible with mysql-proxy ?<br />
<br />
If this possible, do you know where I could find an example of Lua script doing that.<br />
<br />
Thanks,<br />
<br />
Basile.]]></description>
            <dc:creator>Basile Zack</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Fri, 20 Nov 2009 16:19:55 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,290560,290560#msg-290560</guid>
            <title>Unable to use pre-compile mysql-proxy on Redhat 4 (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,290560,290560#msg-290560</link>
            <description><![CDATA[ Hi,<br />
<br />
I downloaded the pre-compiled mysql-proxy for RH4 and initialized things according to the wiki. When I tried to run mysql-proxy, it reported:<br />
<br />
[root@ssss208-057 ~]# service mysql-proxy start<br />
Starting mysql-proxy: 2009-11-10 16:07:58: (critical) chassis.c:981: could not raise RLIMIT_NOFILE to 8192, Invalid argument (22). Current limit still 34359739392.<br />
<br />
How to solve this problem? I searched in Google, only find one entry, but it is not related to my problem.<br />
<br />
Thanks,<br />
Tower]]></description>
            <dc:creator>Tower Gee</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Wed, 11 Nov 2009 23:53:35 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,289878,289878#msg-289878</guid>
            <title>caching via mysql proxy (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,289878,289878#msg-289878</link>
            <description><![CDATA[ Hi,<br />
<br />
I'm thinking of a caching proxy that saves query result in the memcached. I was wondering if mysql proxy is the right place to do so. Is it possible to store state of the proxy in lua scripts between query calls. Once the query is executed I need to know I have cached it and I want to store this information in the proxy. Is it possible?]]></description>
            <dc:creator>Pawel Leszczynski</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Fri, 06 Nov 2009 10:42:27 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,289120,289120#msg-289120</guid>
            <title>MySQL Enterprise Monitor: Agents, Hosts and Instances, Oh My! (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,289120,289120#msg-289120</link>
            <description><![CDATA[ MySQL Enterprise Monitor: Agents, Hosts and Instances, Oh My!<br />
<a rel="nofollow"  href="http://blogs.sun.com/DatabaseEmporium/entry/agents_hosts_and_instances_oh">http://blogs.sun.com/DatabaseEmporium/entry/agents_hosts_and_instances_oh</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Mon, 02 Nov 2009 16:47:26 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,288409,288409#msg-288409</guid>
            <title>MySQL Proxy: Capturing Queries that cause an Error (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,288409,288409#msg-288409</link>
            <description><![CDATA[ MySQL Proxy: Capturing Queries that cause an Error<br />
<a rel="nofollow"  href="http://www.chriscalender.com/?p=66">http://www.chriscalender.com/?p=66</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Wed, 28 Oct 2009 22:38:58 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,288371,288371#msg-288371</guid>
            <title>MySQL Proxy:  Setting up as a Service on Windows (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,288371,288371#msg-288371</link>
            <description><![CDATA[ MySQL Proxy:  Setting up as a Service on Windows<br />
<a rel="nofollow"  href="http://www.chriscalender.com/?p=54">http://www.chriscalender.com/?p=54</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Wed, 28 Oct 2009 17:45:12 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,287987,287987#msg-287987</guid>
            <title>username and password in read_auth (3 replies)</title>
            <link>http://forums.mysql.com/read.php?146,287987,287987#msg-287987</link>
            <description><![CDATA[ Since the auth packet is no longer available in read_auth, how do I get the username and password?<br />
Thanks.<br />
George]]></description>
            <dc:creator>George Lin</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sat, 31 Oct 2009 01:14:28 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,287469,287469#msg-287469</guid>
            <title>Mysql: Aborted connection  - everytime LiveUpdate gets a new virus definition. (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,287469,287469#msg-287469</link>
            <description><![CDATA[ We are getting this issue on a Windows XP with SP2 machine. Mysql Server 4.1 is installed and noticed thru the event viewer log - everytime a new virus definition is loaded - there is this foll. event.<br />
 <br />
Event Type:	Warning<br />
Event Source:	MySQL<br />
Event Category:	None<br />
Event ID:	100<br />
Date:		10/21/2009<br />
Time:		8:43:37 PM<br />
User:		N/A<br />
Computer:	XX<br />
Description:<br />
Aborted connection 10 to db: 'abc' user: 'dba' host: `localhost' (Got an error reading communication packets)<br />
<br />
For more information, see Help and Support Center at <a rel="nofollow"  href="http://www.mysql.com">http://www.mysql.com</a>.]]></description>
            <dc:creator>Anjali A</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sat, 31 Oct 2009 01:17:02 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,286581,286581#msg-286581</guid>
            <title>Getting Result Set Size (2 replies)</title>
            <link>http://forums.mysql.com/read.php?146,286581,286581#msg-286581</link>
            <description><![CDATA[ I have been trying to calculate the size in bytes of a result set.  This is based on the bandwidth calculation example.  It seems to work at first and then eventually, the row values become nil.  It seems to be also at a random number of rows even if I re-run it with the exact same data.  Any help would be GREATLY appreciated!<br />
<br />
BTW, I added a row count to be sure it was going through all of the rows and it is. <br />
<br />
Below is the code I am using:<br />
<br />
local bandwidth = 0<br />
<br />
function read_query (packet )<br />
    bandwidth = bandwidth + string.len(packet)<br />
    proxy.queries:append(1, packet)<br />
    return proxy.PROXY_SEND_QUERY<br />
end<br />
<br />
function read_query_result(inj)<br />
    local rows = inj.resultset.rows<br />
    local fields = inj.resultset.fields<br />
    local rowcount = 0<br />
    local numcols = #inj.resultset.fields<br />
<br />
    if fields then<br />
        for i = 1, #fields do<br />
            bandwidth = bandwidth + (fields[i] and fields[i].name:len() or 0)<br />
        end<br />
<br />
        if rows then<br />
            for row in inj.resultset.rows do<br />
                rowcount = rowcount + 1<br />
<br />
                for i = 1, numcols do<br />
                     print (row[i])<br />
                     bandwidth = bandwidth + (row[i] and row[i]:len() or 0)<br />
                end<br />
            end<br />
        end<br />
        print (&quot;Row Count: &quot; .. rowcount)<br />
        print (&quot;Bandwidth:&quot; .. bandwidth)<br />
    end<br />
end<br />
<br />
Thanks,<br />
Mike]]></description>
            <dc:creator>Mike Patrick</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 29 Oct 2009 17:20:02 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,286308,286308#msg-286308</guid>
            <title>Trouble on setting up  mysql-proxy-0.7.2-linux-rhel5-x86-32bit (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,286308,286308#msg-286308</link>
            <description><![CDATA[ can anyone help me on this?<br />
<br />
<br />
[root@mysqlproxyserver ]# mysql -h 127.0.0.1 -P 1337 -u root -p<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 1<br />
Server version: 5.0.99-agent-admin<br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br />
<br />
mysql&gt; select * from proxy_connections;<br />
ERROR 2006 (HY000): MySQL server has gone away<br />
No connection. Trying to reconnect...<br />
Connection id:    1<br />
Current database: *** NONE ***<br />
<br />
ERROR 1105 (07000): need a resultset + proxy.PROXY_SEND_RESULT<br />
mysql&gt;<br />
<br />
===================<br />
<br />
i started the proxy with<br />
<br />
#!/bin/bash<br />
MASTERDB=192.168.15.128<br />
<br />
ROOT_DIR=/root/mysql-proxy-0.7.2-linux-rhel5-x86-32bit<br />
$ROOT_DIR/sbin/mysql-proxy \<br />
--daemon \<br />
--admin-address=:1337 \<br />
--proxy-backend-addresses=$MASTERDB:3306<br />
<br />
<br />
MySQL IP = 192.168.15.129<br />
DB = 192.168.15.128<br />
<br />
Thanks<br />
Ryan]]></description>
            <dc:creator>Cesar Ryan Mindana</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 29 Oct 2009 17:33:15 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,286070,286070#msg-286070</guid>
            <title>Error running mysql-proxy from source (ibmysql-chassis.so.0) (5 replies)</title>
            <link>http://forums.mysql.com/read.php?146,286070,286070#msg-286070</link>
            <description><![CDATA[ G'day,<br />
I've been trying to get the rw-splitting.lua script to work but the read queries haven't been going to the proxy-read-only-backend-addresses even after creating lots of connections to the proxy:4040<br />
I was using mysql-proxy-0.6.1 from Ubuntu's apt.<br />
After reading a thread here recommending to use 0.7.2 to get query splitting working, I decided to compile &amp; install from source (no binary for debian at this stage).<br />
Compile goes fine but when I try to run mysql-proxy I get this error message<br />
<br />
mysql-proxy: error while loading shared libraries: libmysql-chassis.so.0: cannot open shared object file: No such file or directory<br />
<br />
This is bizarre because a locate shows that the files are there<br />
~# locate libmysql-chassis.so.0<br />
/usr/local/lib/libmysql-chassis.so.0<br />
/usr/local/lib/libmysql-chassis.so.0.0.0<br />
<br />
<br />
Any tips? Thanks!]]></description>
            <dc:creator>Tom M</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sat, 31 Oct 2009 01:20:38 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,284896,284896#msg-284896</guid>
            <title>Using MySQLProxy to solve the &amp;quot;error 2006 - server has gone away&amp;quot; problem (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,284896,284896#msg-284896</link>
            <description><![CDATA[ Hi all.<br />
<br />
I just discovered MySQL Proxy and thought it might be a quick solution for the dreadful &quot;server has gone away problem&quot; that we get with ODBC and other connectors.<br />
<br />
Brief description of the problem: The MySQL server which we can't touch has a low connection timeout (in my case, about 7 seconds). This makes using ODBC through MS Access nearly impossible.<br />
<br />
I thought that MySQL Proxy might be able to send the queries and data back and forth between my system and the server and that I might have a persistent connection from Access to MySQL Proxy. So I simply installed the proxy connecting to the server and changed the table definitions in Access to point to the proxy.<br />
<br />
Alas, I still get the timeouts and the dreaded &quot;server has gone away&quot; messsage.<br />
<br />
Is there an easy way to have MySQL Proxy keep that connection open? Can I make it continuously run a simple query to the server to do this, or is there some other way?<br />
<br />
Thanks in advance.<br />
Eduardo Baldino]]></description>
            <dc:creator>Eduardo Baldino</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Tue, 06 Oct 2009 22:42:19 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,284895,284895#msg-284895</guid>
            <title>Using MySQL Proxy to solve &amp;quot;error 2006 - server has gone away&amp;quot; problem (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,284895,284895#msg-284895</link>
            <description><![CDATA[ Hi all.<br />
<br />
I just discovered MySQL Proxy and thought it might be a quick solution for the dreadful &quot;server has gone away problem&quot; that we get with ODBC and other connectors.<br />
<br />
Brief description of the problem: The MySQL server which we can't touch has a low connection timeout (in my case, about 7 seconds). This makes using ODBC through MS Access nearly impossible.<br />
<br />
I thought that MySQL Proxy might be able to send the queries and data back and forth between my system and the server and that I might have a persistent connection from Access to MySQL Proxy. So I simply installed the proxy connecting to the server and changed the table definitions in Access to point to the proxy.<br />
<br />
Alas, I still get the timeouts and the &quot;server has gone away&quot; messsage.<br />
<br />
Is there an easy way to have MySQL Proxy keep that connection open? Can I make it continuously run a simple query to the server to do this, or is there some other way?<br />
<br />
Thanks in advance.<br />
Eduardo Baldino]]></description>
            <dc:creator>Eduardo Baldino</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 15 Oct 2009 05:52:56 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,284592,284592#msg-284592</guid>
            <title>MySQL proxy query duplication Followup (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,284592,284592#msg-284592</link>
            <description><![CDATA[ I need help as soon as possible.<br />
<br />
Any suggestions would be greatly appreciated.<br />
<br />
Thanks,<br />
Bill<br />
<br />
<a rel="nofollow"  href="http://www.afsfit.com/">Used Fitness Equipment</a>]]></description>
            <dc:creator>Bill Jones</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 29 Oct 2009 17:50:41 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283847,283847#msg-283847</guid>
            <title>MySQL proxy query duplication (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,283847,283847#msg-283847</link>
            <description><![CDATA[ Hi there!<br />
<br />
MySQL proxy seems to be heavily used for R/W type splitting applications. I wish to duplicate queries to two servers and only return data from one of them.<br />
<br />
I realise that MySQL proxy handles load balancing type behaviour with the following syntax: <br />
--proxy-backendaddresses <br />
and if there are multiple backendaddresses then it will start to load balance between them.<br />
<br />
How can I get proxy to do what I need? Any tips for writting the Lua script which will split the query two masters and only return the result from one?<br />
<br />
The two masters should not be aware of each others presence - otherwise I would have used standard replication.<br />
<br />
Thanks for any input!]]></description>
            <dc:creator>Craig David</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sat, 07 Nov 2009 04:27:04 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283760,283760#msg-283760</guid>
            <title>How to Install MySQL Proxy on Windows XP? (2 replies)</title>
            <link>http://forums.mysql.com/read.php?146,283760,283760#msg-283760</link>
            <description><![CDATA[ Hello,<br />
I've downloaded the Windows version of MysQL Proxy and extracted the contents of the zip file to my hard drive.  There is no setup.exe or other similar install prograam.  How do I go about installing MysQL Proxy?<br />
<br />
Thanks,<br />
Sid]]></description>
            <dc:creator>Sid Childers</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 08 Oct 2009 18:14:28 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283500,283500#msg-283500</guid>
            <title>Load balancing issues on a Master/Master architecture (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,283500,283500#msg-283500</link>
            <description><![CDATA[ A combination of a Local Area Network (LAN) and a Wireless LAN (WLAN) is a useful environment for doing parallel computing. We use this infrastructure to implement Master/Slave parallel distributed programs which exhibit strict data dependences among iterations and parallel calculation inside an iteration. In this environment it is necessary to consider the unbalance both processing power and communication bandwidth of fixed and portable computers to avoid long idle times. To solve this problem, in our previous work we developed an efficient load balancing method that considers the heterogeneity both in computing and in communication, and besides, it keeps in mind that the number of processes can vary at run time (processes spawned on portable computers). To program this method is a hard task because it implements a complex mechanism to estimate the data distribution which uses a framework based on Simple Network Management Protocol (SNMP) that has to synchronize with the parallel program to share performance information about computers. For that reason, in this paper we present a library that implements our method of load balancing to ease the programming.<br />
--------------------------------------------------<br />
<a rel="nofollow"  href="http://www.soberpacificliving.com/alcohol-rehabilitation.php">alcohol rehabilitation</a><br />
<a rel="nofollow"  href="http://hghzonecenter.com">HGH</a>]]></description>
            <dc:creator>banglore agent1</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sun, 27 Sep 2009 19:14:45 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283499,283499#msg-283499</guid>
            <title>R/W splitting (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,283499,283499#msg-283499</link>
            <description><![CDATA[ For R/W Splitting we need a connection pooling. We only switch to another backend if we already have a authenticated connection open to that backend. <br />
<br />
The MySQL protocol first does a challenge-response handshake. When we enter the query/result stage it is too late to authenticate new connections. We have to make sure that we have enough open connections to operate nicely.<br />
------------------------------------------------<br />
<a rel="nofollow"  href="http://www.soberpacificliving.com/alcohol-rehabilitation.php">alcohol rehabilitation</a><br />
<a rel="nofollow"  href="http://hghzonecenter.com">HGH</a>]]></description>
            <dc:creator>banglore agent1</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sun, 27 Sep 2009 19:11:54 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283498,283498#msg-283498</guid>
            <title>MySQL error during Insert (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,283498,283498#msg-283498</link>
            <description><![CDATA[ statement insert rows based on explicitly specified values. The INSERT ... SELECT form inserts rows selected from another table or tables. INSERT ... SELECT is discussed further in Section 12.2.5.1, “INSERT ... SELECT Syntax”. <br />
<br />
You can use REPLACE instead of INSERT to overwrite old rows. REPLACE is the counterpart to INSERT IGNORE in the treatment of new rows that contain unique key values that duplicate old rows: The new rows are used to replace the old rows rather than being discarded. See Section 12.2.7, “REPLACE Syntax”. <br />
<br />
tbl_name is the table into which rows should be inserted. The columns for which the statement provides values can be specified as follows: <br />
<br />
You can provide a comma-separated list of column names following the table name. In this case, a value for each named column must be provided by the VALUES list or the SELECT statement. <br />
<br />
If you do not specify a list of column names for INSERT ... VALUES or INSERT ... SELECT, values for every column in the table must be provided by the VALUES list or the SELECT statement. If you do not know the order of the columns in the table, use DESCRIBE tbl_name to find out. <br />
<br />
The SET clause indicates the column names explicitly. <br />
<br />
Column values can be given in several ways: <br />
<br />
If you are not running in strict SQL mode, any column not explicitly given a value is set to its default (explicit or implicit) value. For example, if you specify a column list that does not name all the columns in the table, unnamed columns are set to their default values. Default value assignment is described in Section 10.1.4, “Data Type Default Values”. See also Section 1.7.6.2, “Constraints on Invalid Data”. <br />
<br />
If you want an INSERT statement to generate an error unless you explicitly specify values for all columns that do not have a default value, you should use strict mode. See Section 5.1.8, “Server SQL Modes”. <br />
<br />
Use the keyword DEFAULT to set a column explicitly to its default value. This makes it easier to write INSERT statements that assign values to all but a few columns, because it enables you to avoid writing an incomplete VALUES list that does not include a value for each column in the table. Otherwise, you would have to write out the list of column names corresponding to each value in the VALUES list. <br />
<br />
You can also use DEFAULT(col_name) as a more general form that can be used in expressions to produce a given column's default value. <br />
<br />
If both the column list and the VALUES list are empty, INSERT creates a row with each column set to its default value: <br />
INSERT INTO tbl_name () VALUES();<br />
<br />
In strict mode, an error occurs if any column doesn't have a default value. Otherwise, MySQL uses the implicit default value for any column that does not have an explicitly defined default. <br />
<br />
You can specify an expression expr to provide a column value. This might involve type conversion if the type of the expression does not match the type of the column, and conversion of a given value can result in different inserted values depending on the data type. For example, inserting the string '1999.0e-2' into an INT, FLOAT, DECIMAL(10,6), or YEAR column results in the values 1999, 19.9921, 19.992100, and 1999 being inserted, respectively. The reason the value stored in the INT and YEAR columns is 1999 is that the string-to-integer conversion looks only at as much of the initial part of the string as may be considered a valid integer or year. For the floating-point and fixed-point columns, the string-to-floating-point conversion considers the entire string a valid floating-point value. <br />
<br />
An expression expr can refer to any column that was set earlier in a value list. For example, you can do this because the value for col2 refers to col1, which has previously been assigned: <br />
INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2);<br />
<br />
But the following is not legal, because the value for col1 refers to col2, which is assigned after col1: <br />
INSERT INTO tbl_name (col1,col2) VALUES(col2*2,15);<br />
<br />
One exception involves columns that contain AUTO_INCREMENT values. Because the AUTO_INCREMENT value is generated after other value assignments, any reference to an AUTO_INCREMENT column in the assignment returns a 0.<br />
-----------------------------------------]]></description>
            <dc:creator>banglore agent1</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sun, 27 Sep 2009 19:09:03 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283497,283497#msg-283497</guid>
            <title>Mysql-proxy and phpmyadmin (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,283497,283497#msg-283497</link>
            <description><![CDATA[ Forum profile page for MySQL Proxy on <a rel="nofollow"  href="http://www.mysql.com">http://www.mysql.com</a>. This report page is the aggregated overview from a single forum: MySQL Proxy, located on the Message Board at <a rel="nofollow"  href="http://www.mysql.com">http://www.mysql.com</a>. This forum profile page summarizes the general forum statistics such as: Users Activity, Forum Activity, and Top Authors, which are reported in either a table or graph below for a given reporting time period. Additional forum profile information for &quot;MySQL Proxy&quot; on the Message Board at <a rel="nofollow"  href="http://www.mysql.com">http://www.mysql.com</a> is also shown in the following ways: <br />
<br />
1) Latest Active Threads<br />
2) Hot Threads for Last Week<br />
----------------------------------------<br />
<a rel="nofollow"  href="http://www.soberpacificliving.com/alcohol-rehabilitation.php">alcohol rehabilitation</a><br />
<a rel="nofollow"  href="http://hghzonecenter.com">HGH</a>]]></description>
            <dc:creator>banglore agent1</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Sun, 27 Sep 2009 19:03:44 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,283172,283172#msg-283172</guid>
            <title>can't compile mysql-proxy 0.7.2 (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,283172,283172#msg-283172</link>
            <description><![CDATA[ Hi, All<br />
<br />
I got into trouble when compiling mysql-proxy 0.7.2.<br />
<br />
The following is my enviroment:<br />
<br />
Lua version: 5.1.4<br />
GLIB: 2.22<br />
libtool: 1.5.22<br />
gcc: 4.1.2<br />
linux: Linux zhcn 2.6.18-92.1.6.el5.centos.plus<br />
<br />
The following error was prompted:<br />
<br />
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I/data/mysql/include/mysql  -I..//data/glib-2.22.0 -I..//data/glib-2.22.0/. -I..//data/glib-2.22.0/./glib   -I/usr/local/include   -I..//data/glib-2.22.0/./gmodule -I..//data/glib-2.22.0 -I..//data/glib-2.22.0/. -I..//data/glib-2.22.0/./glib     -g -O2 -MT libmysql_chassis_la-glib-ext.lo -MD -MP -MF .deps/libmysql_chassis_la-glib-ext.Tpo -c -o libmysql_chassis_la-glib-ext.lo `test -f 'glib-ext.c' || echo './'`glib-ext.c<br />
../libtool: line 813: X--tag=CC: command not found<br />
../libtool: line 846: libtool: ignoring unknown tag : command not found<br />
../libtool: line 813: X--mode=compile: command not found<br />
../libtool: line 979: *** Warning: inferring the mode of operation is deprecated.: command not found<br />
../libtool: line 980: *** Future versions of Libtool will require --mode=MODE be specified.: command not found<br />
../libtool: line 1123: Xgcc: command not found<br />
../libtool: line 1123: X-DHAVE_CONFIG_H: command not found<br />
../libtool: line 1123: X-I.: command not found<br />
../libtool: line 1123: X-I..: command not found<br />
../libtool: line 1123: X-I/data/mysql/include/mysql: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0/.: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0/./glib: No such file or directory<br />
../libtool: line 1123: X-I/usr/local/include: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0/./gmodule: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0/.: No such file or directory<br />
../libtool: line 1123: X-I..//data/glib-2.22.0/./glib: No such file or directory<br />
../libtool: line 1123: X-g: command not found<br />
../libtool: line 1123: X-O2: command not found<br />
../libtool: line 1123: X-MT: command not found<br />
../libtool: line 1123: Xlibmysql_chassis_la-glib-ext.lo: command not found<br />
../libtool: line 1123: X-MD: command not found<br />
../libtool: line 1123: X-MP: command not found<br />
../libtool: line 1123: X-MF: command not found<br />
../libtool: line 1123: X.deps/libmysql_chassis_la-glib-ext.Tpo: No such file or directory<br />
../libtool: line 1123: X-c: command not found<br />
../libtool: line 1175: Xlibmysql_chassis_la-glib-ext.lo: command not found<br />
../libtool: line 1180: libtool: compile: cannot determine name of library object from `': command not found<br />
make[3]: *** [libmysql_chassis_la-glib-ext.lo] Error 1<br />
make[3]: Leaving directory `/data/mysql-proxy-0.7.2/src'<br />
make[2]: *** [all] Error 2<br />
make[2]: Leaving directory `/data/mysql-proxy-0.7.2/src'<br />
make[1]: *** [all-recursive] Error 1<br />
make[1]: Leaving directory `/data/mysql-proxy-0.7.2'<br />
make: *** [all] Error 2]]></description>
            <dc:creator>Bond Chen</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 29 Oct 2009 17:46:40 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,282971,282971#msg-282971</guid>
            <title>Master-Master full Redundant/Balanced setup (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,282971,282971#msg-282971</link>
            <description><![CDATA[ Hello,<br />
<br />
I'm looking for some advices/help with LUA scripts.<br />
<br />
We are trying to setup a fully redundant/load-balanced setup of MySQL Proxy with two Masters in bidirectionnal replication.<br />
For now, the development (virtual machines) look like this :<br />
<br />
[MySQL-Proxy]<br />
|<br />
|<br />
([Master1] &lt;-- Replication --&gt; [Master2])<br />
<br />
I'm using latest bazaar release with last rw-splitting.lua<br />
The goal is to have &quot;SELECT&quot; sent to Master2 and everything else to Master1.<br />
If Master1 falls, all queries goes to Master2, if Master1 become available again, MySQL-Proxy goes back to normal usage (Writes -&gt; M1, Reads -&gt; M2).<br />
<br />
But I can't have Master2 recognized as a &quot;slave&quot; in normal behavior, even if I launch MySQL-Proxy like this :<br />
<br />
mysql-proxy --proxy-address=:3306 --proxy-backend-addresses=master1:3306 --proxy-backend-addresses=master2:3306 --proxy-read-only-backend-addresses=master2:3306 --proxy-lua-script=/root/rw-splitting.lua --log-level=debug<br />
<br />
I set master2 to be at the same time a rw and a ro backend but no luck.<br />
<br />
Still, if I do that, I'm not sure it's gonna work as whished.<br />
<br />
Does someone has an idea on how to achieve this or just how to have Master2 recognized as a Master and a Slave ?<br />
<br />
Thanks in advance for you advices and, please, forgive me for my english :)]]></description>
            <dc:creator>Romain K</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 01 Oct 2009 17:07:57 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,281091,281091#msg-281091</guid>
            <title>wxlua (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,281091,281091#msg-281091</link>
            <description><![CDATA[ Is it possible to include wxlua in a lua script?<br />
<br />
I tried but i get all kinds of errors <br />
<br />
My idea was to output to a dialog box so i could monitor the queries.<br />
<br />
Thanks]]></description>
            <dc:creator>brian keith</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Mon, 14 Sep 2009 13:31:20 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,280399,280399#msg-280399</guid>
            <title>Error compiling mysql-proxy (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,280399,280399#msg-280399</link>
            <description><![CDATA[ When i try to compile mysql-proxy-0.7.2 i got this error message : <br />
<br />
chassis.c: In function `main_cmdline':<br />
chassis.c:595: erreur: « LUA_RELEASE » non déclaré (première utilisation dans cette fonction)<br />
chassis.c:595: erreur: (Chaque identificateur non déclaré est rapporté une seule fois<br />
chassis.c:595: erreur: pour chaque fonction dans laquelle il apparaît.)<br />
chassis.c:601: erreur: « LUA_PATH » non déclaré (première utilisation dans cette fonction)<br />
chassis.c:622: erreur: « LUA_CPATH » non déclaré (première utilisation dans cette fonction)<br />
<br />
<br />
Any ideas ?]]></description>
            <dc:creator>HELARY Mathieu</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 29 Oct 2009 17:41:44 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,280196,280196#msg-280196</guid>
            <title>mysql proxy procedure/delimiter issue (1 reply)</title>
            <link>http://forums.mysql.com/read.php?146,280196,280196#msg-280196</link>
            <description><![CDATA[ Hello,<br />
I am trying to convert oracle procedures to mysql using proxy query rewriting ability. I came to problem with delimiter. If I type following commands to mysql client it works. <br />
<br />
delimiter //<br />
create procedure foo()<br />
begin<br />
    select 2+2 from dual;<br />
end;<br />
//<br />
delimiter ;;<br />
<br />
Problem occurs when I send these commands via lua script. My send_query function looks like this:<br />
...<br />
query = &quot;delimiter //\ncreate procedure foo() begin select 2+2 from dual; end;\n//\ndelimiter ;&quot;<br />
proxy.queries:append(1, string.char(proxy.COM_QUERY) .. query)<br />
...<br />
<br />
I got following error:<br />
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter //<br />
create procedure foo() begin select 2+2 from dual; end;<br />
//<br />
delim' at line 1<br />
<br />
Does anyone know how to set delimiter properly?<br />
<br />
Thanks.<br />
<br />
Dusan]]></description>
            <dc:creator>dusan subidub</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Fri, 11 Sep 2009 07:22:29 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,280176,280176#msg-280176</guid>
            <title>MySQL Proxy 0.7.2 Windows Service (2 replies)</title>
            <link>http://forums.mysql.com/read.php?146,280176,280176#msg-280176</link>
            <description><![CDATA[ I'm trying to run MySQL Proxy 0.7.2 as a service under windows server 2003.<br />
<br />
If I run mysql-proxy-svc.exe as the service it starts and runs fine, the problem is I would like to also use the --defaults-file=mysql-proxy.conf option, but when I do so the service starts and stops again immediately.<br />
<br />
I've trawled the net and not been able to find the information I need on this, is anyone else out there running a setup like this?]]></description>
            <dc:creator>Steve Bond</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Fri, 30 Oct 2009 11:27:14 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?146,279542,279542#msg-279542</guid>
            <title>MySQL Proxy having problems with QT (no replies)</title>
            <link>http://forums.mysql.com/read.php?146,279542,279542#msg-279542</link>
            <description><![CDATA[ Hy community,<br />
<br />
im working here on a project to replicate databases, partially using MySQL Proxy.<br />
<br />
Currently using Windows XP Prof and MySQL 5.1.<br />
<br />
I wrote a Lua-Script to copy all Insert-, Delete- and Update-Queries to another Table for replication.<br />
<br />
When i tried to write a program with Visual Studio ++ Express 2008 via the C++ Connector, it worked perfectly, sending a Insert-Query every second.<br />
<br />
When i used the port 4040 for the program, the proxy caught the Insert-Queries and redirected them, everything worked fine.<br />
<br />
<br />
But here comes the Problem:<br />
I am forced to try QT as a C++ Compiler because the program i wrote in VS++ was not portable on machines which did not have VS++ installed (couldn't fix it with /MD mode).<br />
<br />
QT comes with its own drivers for MySQL (though i needed to compile them, they worked at the end).<br />
Sending out queries to my MySQL Server is no Problem, but when i hook up my Proxy in between, its not able to catch the queries!<br />
<br />
<br />
My Lua-Script is now fully packed with prints to analyze what the packet is:<br />
<br />
<br />
<br />
function read_query( packet )<br />
        if packet:byte() == proxy.COM_QUERY then<br />
			local tk = require(&quot;proxy.tokenizer&quot;)<br />
			local query = string.sub(packet, 2)<br />
			local tokens = tk.tokenize(query)<br />
			if tokens[1].token_name == &quot;TK_SQL_INSERT&quot;<br />
				or tokens[1].token_name == &quot;TK_SQL_DELETE&quot;<br />
				or tokens[1].token_name == &quot;TK_SQL_UPDATE&quot;<br />
			then<br />
				proxy.queries:append(1, packet)<br />
				proxy.queries:append(2, string.char(proxy.COM_QUERY) .. &quot;INSERT INTO test2.storequeries (commands) VALUES ('&quot; .. query..&quot;');&quot;)<br />
				print (&quot;rerouted query&quot;)<br />
				return proxy.PROXY_SEND_QUERY<br />
			else<br />
				print (&quot;me a query&quot;)<br />
			end<br />
		elseif packet:byte() == proxy.COM_QUIT then<br />
			print (&quot;me a quit&quot;);<br />
		elseif packet:byte() == proxy.COM_INIT_DB then<br />
			print (&quot;me a COM_INIT_DB&quot;);<br />
		elseif packet:byte() == proxy.COM_FIELD_LIST then<br />
			print (&quot;me a COM_FIELD_LIST&quot;);<br />
		elseif packet:byte() == proxy.COM_CREATE_DB then<br />
			print (&quot;me a COM_CREATE_DB&quot;);<br />
		elseif packet:byte() == proxy.COM_DROP_DB then<br />
			print (&quot;me a COM_DROP_DB&quot;);<br />
		elseif packet:byte() == proxy.COM_REFRESH then<br />
			print (&quot;me a COM_REFRESH&quot;);<br />
		elseif packet:byte() == proxy.COM_SHUTDOWN then<br />
			print (&quot;me a COM_SHUTDOWN&quot;);<br />
		elseif packet:byte() == proxy.COM_STATISTICS then<br />
			print (&quot;me a COM_STATISTICS&quot;);<br />
		elseif packet:byte() == proxy.COM_PROCESS_INFO then<br />
			print (&quot;me a COM_PROCESS_INFO&quot;);<br />
		elseif packet:byte() == proxy.COM_PROCESS_KILL then<br />
			print (&quot;me a COM_PROCESS_KILL&quot;);<br />
		elseif packet:byte() == proxy.COM_DEBUG then<br />
			print (&quot;me a COM_DEBUG&quot;);<br />
		elseif packet:byte() == proxy.COM_PING then<br />
			print (&quot;me a COM_PING&quot;);<br />
		elseif packet:byte() == proxy.COM_CHANGE_USER then<br />
			print (&quot;me a COM_CHANGE_USER&quot;);<br />
		elseif packet:byte() == proxy.COM_BINLOG_DUMP then<br />
			print (&quot;me a COM_BINLOG_DUMP&quot;);<br />
		elseif packet:byte() == proxy.COM_TABLE_DUMP then<br />
			print (&quot;me a COM_TABLE_DUMP&quot;);<br />
		elseif packet:byte() == proxy.COM_REGISTER_SLAVE then<br />
			print (&quot;me a COM_REGISTER_SLAVE&quot;);<br />
		elseif packet:byte() == proxy.COM_PREPARE then<br />
			print (&quot;me a COM_PREPARE&quot;);<br />
		elseif packet:byte() == proxy.COM_EXECUTE then<br />
			print (&quot;me a COM_EXECUTE&quot;);<br />
		elseif packet:byte() == proxy.COM_LONG_DATA	 then<br />
			print (&quot;me a COM_LONG_DATA&quot;);<br />
		elseif packet:byte() == proxy.COM_CLOSE_STMT then<br />
			print (&quot;me a COM_CLOSE_STMT&quot;);<br />
		elseif packet:byte() == proxy.COM_RESET_STMT then<br />
			print (&quot;me a COM_RESET_STMT&quot;);<br />
		elseif packet:byte() == proxy.COM_SET_OPTION then<br />
			print (&quot;me a COM_SET_OPTION&quot;);<br />
		elseif packet:byte() == proxy.COM_FETCH_STMT then<br />
			print (&quot;me a COM_FETCH_STMT&quot;);<br />
		else<br />
			print (&quot;dont know what this one is&quot;)<br />
		end<br />
end<br />
<br />
<br />
<br />
(sorry for non-code-format)<br />
<br />
As you can see, i addd every known packet indicator, but still my proxy prints out<br />
&quot;dont know what this one is&quot; ...<br />
though the query comes only every second, my proxy prints this line 4 times a second (starting with 3 as i start the program).<br />
<br />
Is QT using a packet-format that the Proxy doesn't know?<br />
<br />
For QT, im using the <br />
<br />
QSqlQuery query(&quot;INSERT INTO webtest (parameter) VALUES ('testor')&quot;);<br />
<br />
statement.]]></description>
            <dc:creator>Frank Norman</dc:creator>
            <category>MySQL Proxy</category>
            <pubDate>Thu, 03 Sep 2009 12:32:51 +0000</pubDate>
        </item>
    </channel>
</rss>
