MySQL Forums
Forum List  »  Router & Proxy

Re: Installing LuaSocket with MySQL Proxy
Posted by: Chris Calender
Date: August 20, 2010 08:01PM

http://www.chriscalender.com/?p=126

I was able to get this working, so let me post my steps, and perhaps that will help you (note that I did encounter the same error you did at one point).

1. Downloaded LuaSocket 2.0.1 (contains lua/ and lib/ directories)

2. Copied contents of 'lua/' into the following directory:

C:\Program Files\MySQL\mysql-proxy-0.8.0\lib\mysql-proxy\lua

3. Copied contents of 'lib/' into the following directory:

C:\Program Files\MySQL\mysql-proxy-0.8.0\bin

4. In step #3, you should have copied a 'socket/' and 'mime/' directories into bin/. Rename the directory named "socket" to "lua-socket". This will get you past one set of errors.

5. Next, in the C:\Program Files\MySQL\mysql-proxy-0.8.0\bin, there is a file named lua51.dll. If you try to run it now, you'll get an error saying "lua5.1.dll was not found". So I made a copy of "lua51.dll" and renamed it "lua5.1.dll", in the same directory.

Now when I start my script, it works, and can access the socket functions.

For instance, my proxy basedir is, which is also where my script is located:

C:\Program Files\MySQL\mysql-proxy-0.8.0\

I invoked my script as follows:

C:\Program Files\MySQL\mysql-proxy-0.8.0\bin>mysql-proxy.exe --proxy-lua-script=show-vars.lua --lua-cpath=!\\lua-?.dll --lua-path=!\\..\\lib\\mysql-proxy\\lua\\?.lua;!\\..\\lib\\mysql-proxy\\lua\\socket\\?.lua


show-vars.lua is the name of my lua script.

In it, I have the following 2 lines:

socket = require("socket")
print(socket._VERSION)

And when I start up the script, and connect to my instance, it outputs the following:

LuaSocket 2.0.1

Hope this helps.



Edited 1 time(s). Last edit at 08/21/2010 12:00PM by Edwin DeSouza.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Installing LuaSocket with MySQL Proxy
2755
August 20, 2010 08:01PM


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.