|
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
--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 resultsrow = cur:fetch (row,
"a") endprint(str)
cur:close();
[code:]