Git Product home page Git Product logo

Comments (5)

agentzh avatar agentzh commented on July 25, 2024

There is already an ngx.quote_sql_str() function in ngx_lua:

http://wiki.nginx.org/HttpLuaModule#ngx.quote_sql_str

from lua-resty-mysql.

agentzh avatar agentzh commented on July 25, 2024

See also https://github.com/agentzh/lua-resty-mysql#sql-literal-quoting

from lua-resty-mysql.

toontong avatar toontong commented on July 25, 2024

能否增加, 在query时连接中断,自动重连,因为是连接池,自动重连应该是必需的吧。
型如:
res, err = db:query(sql)
if err == connect_lost then
db:auto_reconnect()
return db:query(sql)
end
原因是:ngx error log中出现很连接中断的情况。是连接闲着挂起太长时间,被mysqld中断。

from lua-resty-mysql.

agentzh avatar agentzh commented on July 25, 2024
  1. Generally, this is your responsibility to reconnect to mysql because automatic error handling can be hairy.
  2. Ensure that you configure the "max_idle" time argument when calling set_keepalive(). This controls the maximal idle time for the current connection when in the connection pool. See the documentation for details: https://github.com/agentzh/lua-resty-mysql#set_keepalive
  3. Do not post a comment that is unrelated to the current issue.
  4. Finally, do not use Chinese here. If you insist, please join the openresty (Chinese) mailing list: https://groups.google.com/group/openresty

from lua-resty-mysql.

toontong avatar toontong commented on July 25, 2024

Please delete the issues.

----------------------------- 华 丽 的 分 隔 线 -----------------------------
+------------------------------------------------------------------+
| ^^ 继续努力.....赶上.....然后超越....... ^^ |
+------------------------------------------------------------------+
----------------------------- 华 丽 的 分 隔 线 -----------------------------

2013/6/27 Yichun Zhang [email protected]

  1. Generally, this is your responsibility to reconnect to mysql
    because automatic error handling can be hairy.
  2. Ensure that you configure the "max_idle" time argument when calling
    set_keepalive(). This controls the maximal idle time for the current
    connection when in the connection pool. See the documentation for details:
    https://github.com/agentzh/lua-resty-mysql#set_keepalive
  3. Finally, do not use Chinese here. If you insist, please join the
    openresty (Chinese) mailing list:
    https://groups.google.com/group/openresty


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-20068990
.

from lua-resty-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.