[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luasql and sphinxql
- From: tomas <tomas@...>
- Date: Tue, 13 Oct 2015 12:16:04 -0300
On 2015-10-13 08:44, David Muscut wrote:
Are you sure this is possible? Note that LuaSQL's MySQL driver is just
a bind to the C API. When you try to connect to the database, you are
calling mysql_real_connect with the same parameters provided to Lua and
some default: the unix_socket will be always NULL and the client_flag
will be always 0. The driver also does not provide any support for
I want to script a query to a SphinxQL server (via the MySQL 4.1
transport protocol). I can query the server properly via the command
line mysql client, but am unable to via luasql. Can someone point me
to a working example of how to use luasql to query a sphinxql server?
It seems that the --protocol=tcp is important when using mysql client,
but I am not sure if this affects LuaSQL usage.
The following works:
$ mysql -P9306 --protocol=tcp --prompt='sphinxQL> '
As Phillip Janda already mentioned, you are using the connect method
incorrectly, unless your database is called 'localhost' and your user is
called '9306' :-) You have to provide the strings for each argument or
The following does not:
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
mysql = require "luasql.mysql"
env = mysql.mysql()
nil LuaSQL: error connecting to database. MySQL: Access denied for
user '9306'@'localhost' (using password: NO)
nil LuaSQL: error connecting to database. MySQL: Can't connect to
MySQL server on '9306' (22)
connection = env:connect("database-name", "username", "password", nil,
Have you tried something like that?