安装luarocks安装驱动
yum install libtermcap-devel ncurses-devel libevent-devel readline-devel--安装lua前提条件
LuaSQL 可以使用 LuaRocks 来安装可以根据需要安装你需要的数据库驱动。
LuaRocks 安装方法:
$ wget http://luarocks.org/releases/luarocks-2.2.1.tar.gz
$ tar zxpf luarocks-2.2.1.tar.gz
$ cd luarocks-2.2.1
$ ./configure; sudo make bootstrap
$ sudo luarocks install luasocket
$ lua
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> require "socket"
安装不同数据库驱动:
luarocks install luasql-sqlite3
luarocks install luasql-postgres
luarocks install luasql-mysql
luarocks install luasql-sqlite
luarocks install luasql-odbc
---yum install mysql++-devel.x86_64
---luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql
--ln -s /usr/lib64/mysql/libmysqlclient.so.18.0.0 /usr/lib64/libmysqlclient.so
luarocks install luasql-mysql