如何从tarantool连接到mysql?

时间:2016-03-29 15:11:37

标签: mysql lua tarantool

我尝试使用tarantool作为应用程序服务器,并希望从tarantool连接到mysql。

在lua中我写了一个函数:

local function mysql_data(query, limit)
    local conn = mysql.connect({host = mysql_host, user = mysql_user, password = mysql_password, db = mysql_database})
    local tuples = conn:execute(query, limit)
    return tuples   
end

但在日志中我看到:

2016-03-29 17:57:37.358 [8553] main/101/grepmaillog_app.lua F> /home/lua/./grepmaillog_app.lua:12: module 'mysql' not found:
        no field package.preload['mysql']
        no file './mysql.lua'
        no file './mysql/init.lua'
        no file '/root/.luarocks/share/lua/5.1/mysql.lua'
        no file '/root/.luarocks/share/lua/5.1/mysql/init.lua'
        no file '/root/.luarocks/share/lua/mysql.lua'
        no file '/root/.luarocks/share/lua/mysql/init.lua'
        no file '/usr/local/share/tarantool/mysql.lua'
        no file '/usr/local/share/tarantool/mysql/init.lua'
        no file '/usr/share/tarantool/mysql.lua'
        no f

我如何为tarantool安装包mysql?

1 个答案:

答案 0 :(得分:1)

请从http://tarantool.org/download.html

安装tarantool-mysql包