Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 10 of 26 10 Older Entries

Displaying posts with tag: mysql-proxy (reset)

Lua and mysql-proxy: how to send a query to an email
Employee +3 Vote Up -0Vote Down

I recently got an inquiry on how to receive an email every time a query was executed via the MySQL proxy. This is very simple and you can achieve it by simply piping the query to the *nix mail command. Here is the sample code (in a file caled send_mail.lua):

function read_query(packet)
  if string.byte(packet) == proxy.COM_QUERY then
    print("Hello world! Seen the query: " .. string.sub(packet, 2))
    print("Sending query to email:")
    os.execute("echo " .. string.sub(packet, 2) .. "| mail -s'Lua test' ")

To execute this, install proxy as per the instructions in the manual. Then simply run the proxy and point it at your script:

  [Read more...]
Slapping MySQL-Proxy
+0 Vote Up -0Vote Down

I have old applications that need to read (and write) MyISAM tables that themselves receive lots of bulk updates. Time to try MySQL-Proxy.

MySQL Proxy is light on documentation and very few people written anything about working.   Most of what I have read says MySQL-Proxy is not ready for prim time.  I have hope so I had to give it a try.

I started with thee VMware servers. I setup one master and two read only slaves.   I tested the replication with mysqlslap from another independent server and it worked fine.  The slave never ran more then a second behind.

I downloaded

  [Read more...]
Catching erroneous queries, without MySQL proxy
+8 Vote Up -0Vote Down

MySQL Proxy is a really neat tool. I remember a few years back when I first saw Jan talking about it. Back in those days it was significantly different than it is now, but the concept remains the same: direct your database traffic through a man-in-the-middle. Chris Calender’s post on capturing erroneous queries with MySQL Proxy shows one use for Proxy. But wait. MySQL Proxy is just inspecting the MySQL protocol. And unless you’re using it for something else too, having a man in the middle to catch errors is like standing in the middle of the street and blocking traffic to count the cars on the street. Why don’t you stand on the sidewalk to count the cars instead?

Observing without interrupting

Maybe we can use tcpdump. If you search Google you’ll see lots of

  [Read more...]
Updated mysql-proxy benchmarking script (for proxy 0.7)
+0 Vote Up -0Vote Down
My previous post contained a lua script for MySQL proxy that would generate benchmarking information. However, just days (or maybe hours?) after I published it, release 0.7 of mysql-proxy was published, making my script obsolete. I’ve fixed this (it needed just a minor tweak), so here‘s a tarball with the following: trace.lua, which is the […] Related posts:
  • Using MySQL Proxy to benchmark query performance By transparently sitting between client and server on each request,...
  • New release of MySQL Proxy GPL MySQL Proxy has a new release, just three days ago,...
  • Using
  •   [Read more...]
    Using MySQL Proxy to benchmark query performance
    +0 Vote Up -0Vote Down

    By transparently sitting between client and server on each request, MySQL Proxy offers many possibilities for query manipulation.

    Many are explored in the cookbook, and they even include a histogram recipe. Still, I wanted to learn more about the proxy while working on a script that would let me get some stats on the queries executed against a server (or group of servers).

    First things first, get a brief glimpse of the lua programming language since that’s what the proxy’s scripts are written in. Alternatively, you can jump straight into the sample scripts, extrapolate what you don’t

      [Read more...]
    MySQL Proxy is back
    +0 Vote Up -0Vote Down

    MySQL Proxy is back. After a long hiatus due to many deadlines in the Proxy team, the GPL version of MySQL Proxy has been updated.
    The most important news is the location. Proxy is now hosted on Launchpad, like many more MySQL related projects, and MySQL code itself.

    Kay and Jan announced and commented the changes. The repository is now on Bazaar, and there are rules for

      [Read more...]
    Current project status – HSCALE
    +0 Vote Up -0Vote Down

    A lot of people keep asking me about the status of HSCALE so I thought it is best to just write about it.
    Since I am waiting for the next GPL release of MySQL Proxy I concentrate on other things, both project-related and not project-related.

    Continuous integration and test strategy enhancements

    First of all there is a CI server up for almost 3 months now. Check out (Login as guest user). I also introduced a lint-process to discover bugs in my LUA code which arise mostly by mistyping variable names. By the way: You should definitely have a lint-like process in place if you are doing LUA programming or other languages of that type. It helps a lot.

    What’s in svn trunk?

    Multiple backends

    The current status is this:

      [Read more...]
    What is an “unauthenticated user”?
    +0 Vote Up -0Vote Down

    Every so often we have a client worrying about unauthenticated users. For example, as part of the output of SHOW PROCESSLIST they will see:

    | Id  | User                 | Host               | db   | Command | Time | State | Info             |
    | 235 | unauthenticated user |   | NULL | Connect | NULL | login | NULL             |
    | 236 | unauthenticated user | | NULL | Connect | NULL | login | NULL             |
    | 237 | user                 | localhost          | NULL | Query   | 0    | NULL  | show processlist |
      [Read more...]
    LuaSQL fetches results about 15% faster than MySQL Proxy?
    +0 Vote Up -0Vote Down

    While evaluating LuaSQL as backend connection replacement I came across this. I did a quick performance test using mysqlslap and it showed that just reading and copying the result can be significantly faster with LuaSQL.

    Benchmark details

    What I did was just sending the query to the backend and building up a new result-set in LUA.

    This is the code for LuaSQL:

    local _sqlEnv = assert(luasql.mysql())
    local _con = nil

    function read_auth(auth)
        local host, port = string.match(proxy.backends[1].address,

      [Read more...]

    Version 0.3 of HSCALE is almost in the door
    +0 Vote Up -0Vote Down

    After working on build and test improvements (for example incorporating lualint and LuaCov) as well as other lua “side-projects” (i.e. Log4LUA) we are running towards HSCALE 0.3.

    The focus of the forthcoming version 0.3 of HSCALE is Dictionary Based Partition Lookup. Using this partition lookup module lets you take full control over how your partitions are created and where they are actually located.

    Update: Dictionary Based Partition Lookup is fully implemented. See this blog post and the wiki page about it.

    Please note: Due to

      [Read more...]
    Showing entries 1 to 10 of 26 10 Older Entries

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    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.