How to connect & query MySQL from within Lua?

前端 未结 3 1946
南笙
南笙 2021-02-07 18:48

How can I connect to a MySQL database from using Lua programming language?

If a good/popular library exists, what is it?

3条回答
  •  野的像风
    2021-02-07 19:07

    In case your mysql database is remote, you can add host as another optional parameter to connect. Port can follow host as well:

    con = assert (env:connect("dbname","user","password","host",port))
    

提交回复
热议问题