MySQL Forums
Forum List  »  Router & Proxy

Some Queries not being logged by MySQL Proxy
Posted by: Eric Hernandez
Date: September 11, 2012 01:57PM

Hello,

I am using mysql proxy in front of my database server to log all queries submitted by users.

Overall the proxy logging works and has worked for me for years.
However, recently i had a user running a select * from some_table and his queries were not being logged even though he was going through the proxy.

This user was running select * every night on 10-15 different tables and every night the mysql proxy only logged
"set autocommit=1"
The rest of the query was not logged.

The user is coming from windows using SAS and odbc to run his query.

The odd thing is that the logging works without exception for everyone else.

Has anybody had a similar problem?

I am currently working on duplicating the problem but it has been a challenge since I am not a big windows or SAS user.

Here is some of my code that I am using.

function read_query( packet )
if string.byte(packet) == proxy.COM_QUERY then
local query = string.sub(packet, 2)
logline = ( string.format("# %s -- %s@%s/%s -- [ %6d ] %s\n%s\n\n", os.date('%Y-%m-%d %H:%M:%S'),
proxy.connection.client.username,
proxy.connection.server.dst.name,
proxy.connection.server["default_db"],
proxy.connection.server.thread_id,
proxy.connection.client.src.name,
query ))
writelogline ( logline )
end
end

I am running:
mysql-proxy 0.8.0
glib2: 2.24.2
libevent: 1.4.13-stable
lua: Lua 5.1.4
LUA_PATH: /usr/lib/mysql-proxy/lua/?.lua
LUA_CPATH: /usr/lib/mysql-proxy/lua/?.so
== plugins ==
admin: 0.7.0
proxy: 0.7.0

Options: ReplyQuote


Subject
Views
Written By
Posted
Some Queries not being logged by MySQL Proxy
3782
September 11, 2012 01:57PM


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.