lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
545 stars 191 forks source link

Cannot install luasql-odbc(No results matching query were found) #83

Closed sylfree9999 closed 5 years ago

sylfree9999 commented 6 years ago

Hi, I'm quite new to lua and linux. So if anything silly, please bear with me. What I'm trying to do is to connect a remote ms sql server from centos 7. I tried to install luasql-odbc. So I installed lua and luarocks, unixODBC and msodbcsql(don't know if this helps). But when I tried luarocks install luasql-odbc, it says No results matching query were found. Can anyone helps how I can install the luasql-odbc? 20171030160518

PS. I have also tried using luarocks install --server=http://luarocks.org/dev luasql-odbc

But with the error: cp: cannot stat ‘src/*.so’: No such file or directory 20171030160518

AnkurThakur commented 6 years ago

I know it is quite late. But still, I would like to post the solution here for anyone facing the same problem. Installed it manually as:

  1. Cloned this LuaSQL using git to somewhere on the server.
  2. Inside the source code, modified the config file provided and changed PREFIX ?= /usr and LUA_SYS_VER ?= 5.1 according to my installation. Example: I used PREFIX ?= /usr/local instead of the default.
  3. Inside the Makefile, you'll see that you can build the odbc.so with make odbc command and it will save odbc.so file inside src.
  4. At last, running make install will copy this odbc.so file to required directories.

Now you can test it inside lua by running require "luasql.odbc"

tomasguisasola commented 5 years ago

It seems the problem could be solved with adequate parameters to make, don't you agree?