I was playing with the 5 sample tutorial Lua scripts available here with the MySQL Proxy, but I was doing something a little inefficiently.
I started mysqld, then I started the MySQL Proxy with the lua script, then connected to MySQL via the proxy. To test a different script I was actually killing the MySQL Proxy and restarting with appropriate script, but this is unnecessary. MySQL Proxy will re-read the lua script, as specified with –proxy-lua-script on new connection. All I need to do is copy in the file in question and get a new mysql client connection.
The tech version of the right way:
$ cp tutorial-basic.lua running.lua $ ./mysql-proxy --proxy-lua-script=running.lua & $ mysql -uusr -p -P4040 -h127.0.0.1 mysql> # do my stuff mysql> exit; $ cp …[Read more]