Hello! 2014-05-07 5:20 GMT-07:00 zhenzhenyang612: > 为什么我在init_by_lua_file 命令里写 > local db,err=mysql:new() > if not db then > ngx.log(ngx.ERR,err) > return > end > 这些代码会报 /usr/local/openresty/lualib/resty/mysql.lua:458: no request found > 不能在init_by_lua_file 命令里写吗 > 不能。见 lua-resty-mysql 官方文档中对此专门的说明: https://github.com/openresty/lua-resty-mysql#limitations -agentzh
Hello! 2014-05-13 5:12 GMT-07:00 李阳光: > 我想通过resy.mysql在nginx初始化阶段读取配置,但是resty.mysql不支持在init_by_lua中执行 > 请问有别的替代方案吗? > 眼下你可以随便使用市面上某个阻塞的 Lua mysql 库,只要可以可靠工作就好。毕竟在 init_by_lua 里面使用阻塞 IO 是无所谓的。 Regards, -agentzh