MAC OS
安装 luarocks
brew install luarocks
本机默认 lua 版本为 5.3,可通过 --lua-dir 选择需要安装的版本
安装 luasocket
luarocks install luasocket
安装mysql、postgres
brew install mysql
brew install postgres
安装 luasql-mysql、luasql-postgres
luarocks install luasql-mysql MYSQL_INCDIR=/usr/local/Cellar/mysql/8.0.18_1/include/mysql/
luarocks install luasql-postgres PGSQL_DIR=/usr/local/Cellar/postgresql/12.1/
验证
> local mysql = require "luasql.mysql"
>
> local postgres = require "luasql.postgres"
>