الثلاثاء، 24 ديسمبر 2013

MySQL Proxy Error: Cannot Load Module "mysql.password"

I am trying to test out a MySQL Proxy Script to handle authentication. And I keep getting errror

2013-12-25 00:25:31: (critical) (lua-error) [E:\Downloads\MySQL\proxy\script.txt][string "E:\Downloads\MySQL\proxy\script.txt"]:2: module 'mysql.password' not found: no field package.preload['mysql.password'] no file 'E:\Downloads\MySQL\proxy\lib\mysql-proxy\lua\mysql\password.lua' no file 'E:\Downloads\MySQL\proxy\bin\lua-mysql\password.dll' no module 'mysql.password' in file 'E:\Downloads\MySQL\proxy\bin\lua-mysql.dll'

Following is my code. By the looks of the message I am missing some files. But I could not find any help by searching. Any help will be appreciated.

local proto = assert(require("mysql.proto"))local password = assert(require("mysql.password"))function read_auth() print(" username : " .. proxy.connection.client.username) print(" password : " .. string.format("%q", proxy.connection.client.scrambled_password)) local c = proxy.connection.client local s = proxy.connection.server if c.username == "test" and -- the username we want to map password.check( s.scramble_buffer, c.scrambled_password, password.hash(password.hash("test")) -- its valid password ) then proxy.queries:append(1, proto.to_response_packet({ username = "root", response = password.scramble(s.scramble_buffer, password.hash("admin")), charset = 8, -- default charset database = c.default_db, max_packet_size = 1 * 1024 * 1024 }) ) return proxy.PROXY_SEND_QUERY -- works if you use lp:mysql-proxy r694 or later endend

View the original article here

ليست هناك تعليقات:

إرسال تعليق