mysql-proxy not running lua script -
mysql-proxy not running lua script -
i know there many mysql-proxy questions on so, have read through many of them , none seem solve problem. trying mysql-proxy , running, eventual purpose of rewriting queries go through proxy. using ubuntu 14.04, have mysql-proxy version 0.8.1, , mysql version 5.5.37. start mysql-proxy run next line on command line
sudo mysql-proxy --defaults-file=mysql-proxy.cnf
where file mysql-proxy.cnf looks following:
[mysql-proxy] log-file= /var/log/mysql/proxy-error.log log-level= debug admin-lua-script= /usr/lib/mysql-proxy/lua/admin.lua proxy-lua-script= /path/to/lua/script/example.lua admin-username = myusername admin-password = mypassword proxy-skip-profiling = true proxy-address = localhost:4040 proxy-backend-addresses = localhost:3306 plugins = proxy,admin
my example.lua script simple, , meant verify mysql-proxy query beingness altered. example.lua pasted below
-- first_example.lua function read_query(packet) if string.byte(packet) == proxy.com_query print("hello world! seen query: " .. string.sub(packet, 2)) end end
since don't run --daemon flag, when run line above in command line loops indefinitely, expected.
finally, in separate terminal session, run next on command line , come in password in order connect proxy
mysql -u myusername -p -h localhost -p 4040
i select database use, , run simple select query on 1 of tables. based on multiple articles/tutorials i've read on mysql-proxy, first console session, 1 ran mysql-proxy, should print out info based on example.lua file. not happen, in fact nil happens.
i'm not sure if next bit of info makes difference, in "my.cnf" mysql configuration file, have these couple of lines
bind-address = 255.255.255.255 #bind-address = 127.0.0.1
where have replaced actual ip address 255.255.255.255 because not want display ip address publicly.
please, have been trying figure out several days, , no amount of new lua scripts, or changing host:port parameters in mysql-proxy.cnf file have solved anything. i
mysql lua mysql-proxy
Comments
Post a Comment