lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Thanks, that did the trick. In case this helps anyone else I used the following code:

$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012, PUC-Rio
> mysql = require "luasql.mysql"
> env  = mysql.mysql()
> conn, e = env:connect('test1','','','','9306')


On Tue, Oct 13, 2015 at 5:47 PM, Philipp Janda <> wrote:
Am 13.10.2015 um 15:50 schröbte David Muscut:
On Tue, Oct 13, 2015 at 4:34 PM, Philipp Janda <> wrote:

The luasql documentation[1] says that the first argument (after `self`)
has to be the `sourcename` (I think that's the database name):


Hi Philip,

I tried that as well, however when I use the index name lua can't connect
to the sphinxql server.

What is the index name?

The other strange bit is that there is no
authentication to the sphinxql server, while there is to mysql, however I
get an access denied when I don't include the mysql credentials even though
the connection request specifies the sphinxql server on port 9306.

All arguments except the `sourcename` are optional, so you could pass `nil` for those (port should be 9306 of course). You can try passing the empty string `""` as sourcename. Unfortunately, there is no way to force TCP as transport protocol, but hopefully specifying a port (and maybe "" as hostname) will be sufficient.

Anyway, passing "localhost" (or "user") as sourcename won't do any good.

- D

Good luck!