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 Lua.org, PUC-Rio
> mysql = require "luasql.mysql"
> env  = mysql.mysql()
> conn, e = env:connect('test1','','','127.0.0.1','9306')

...

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


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

     env:connect(sourcename[,username[,password[,hostname[,port]]]])


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 "127.0.0.1" as hostname) will be sufficient.

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


- D


Good luck!

Philipp