Hello!
On Tue, Aug 20, 2013 at 8:13 PM, wgm_china wrote:
> 我想init_by_file中把mysql表的数据取出来存放在openresty shared_dict中,不过现在在初始化mysql的时候报错,不知有没有办法可以解决?
lua-resty-mysql 使用的是 ngx_lua 的 TCP cosocket API,而这个 API 在 init_by_lua 的上下文中是禁用的:
http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp
注意 ngx.socket.tcp 这个接口支持的上下文(Context)列表中并没有 init_by_lua.
同时,lua-resty-mysql 库的文档中对此也有提及:
https://github.com/agentzh/lua-resty-mysql#limitations
引用一下原文,“This library cannot be used in code contexts like set_by_lua*,
log_by_lua*, and header_filter_by_lua* where the ngx_lua cosocket API
is not available.”
另外,建议在邮件列表中发言之前首先加入列表,否则你的邮件总是需要人工审核。加入的方法是:“发送空白邮件到地址
openresty+subscribe@googlegroups.com 即可完成订阅。”
Regards,
-agentzh
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 openresty@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html