MySQL Forums
Forum List  »  Router & Proxy

Re: can't get
Posted by: Chris Calender
Date: May 19, 2010 09:19AM

That would explain it. This variable,, was added in Proxy 0.7.0. So it would not have been available in 0.6.0.

However, it should work fine in 0.8.0. The only thing I should note is that in 0.8.0, the auth packet is no longer passed to read_handshake(), but you can still access the information stored in the connection tables (i.e.,,, etc.).

I'd also like to point out the following blog post I wrote:

It is basically a trace function which allows you to see all of the available variables that you can access within a lua script, how to access them, and a trace of the various functions as a statement is routed through proxy. So that may be helpful.

And just so you know, I added your code (the following 6 lines) to my read_handshake() function in the above script, and it output the information correctly:

print("<-- let's send him some information about us")
print(" mysqld-version: " .. proxy.connection.server.mysqld_version)
print(" thread-id : " .. proxy.connection.server.thread_id)
print(" scramble-buf : " .. string.format("%q",proxy.connection.server.scramble_buffer))
print(" server-addr : " ..
print(" client-addr : " ..

Here is the output snippet from just that function:

/* Entering function read_handshake() */
Handshake information is sent by the server to the client
after the initial connection (through connect_server()) has
been made. read_handshake() doesn't receive a parameter
anymore. Instead all the data is available in the connection

<-- let's send him some information about us
mysqld-version: 50090
thread-id : 34
scramble-buf : ":(Yft7Sy+gGljQ4OqkHb"
server-addr :
client-addr :


So you can see it outputs the information I had, and then it displays the information you are seeking.

I hope this helps.

Options: ReplyQuote

Written By
Re: can't get
May 19, 2010 09:19AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.