lua-users home
lua-l archive

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


Have done alot of searching on this one without an answer. 
 
     I'm developing a script using the LuaEclipse plugin and LuaSQL.  When I try to run my connect script using the linked interpreter I get the below error. 
However, If I drop down to the commandLine the Database query executes sucessfully. The LuaSQL dll's are in the root level of the Lua Folder which appears to be in the CPATH.   Has anyone else encountered this error within this environment?
 

Z:\Lua\lua5.1.exe: Z:\workspace\DBConnection\DBConnect.lua:9: LuaSQL: Error connecting to database. MySQL: Can't create TCP/IP socket (10091)

stack traceback:

[C]: in function 'assert'

Z:\workspace\DBConnection\DBConnect.lua:9: in main chunk

[C]: ?

PATH:.\?.lua;Z:\Lua\lua\?.lua;Z:\Lua\lua\?\init.lua;Z:\Lua\?.lua;Z:\Lua\?\init.lua

CPATH:.\?.dll;Z:\Lua\?.dll;Z:\Lua\loadall.dll

 
 
[code:]

--dofile("Z:/workspace/DBConnection/config.lua")

print(

"PATH:" .. package.path)

print("CPATH:" .. package.cpath)

require "luasql.mysql"

env = assert (luasql.mysql())

con = assert (env:connect(

"luadev","poiuser", "passwd","127.0.0.1", 3306));

cur = assert (con:execute

"SELECT Name, Lat, Lon, URL FROM poi")

row = cur:fetch ({},

"a")

local

str = ""

while row do -- a loop to go trough all rows.

str = str ..

"\n" .. row.Name .. " [" .. row.Lat .. "] [".. row.Lon.. "] [".. row.URL .. "]"

-- reusing the table of results

row = cur:fetch (row,

"a")

end

print(str)

cur:close();

[code:]