博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
luasql在Fedora20下的安装与使用示例
阅读量:4701 次
发布时间:2019-06-09

本文共 586 字,大约阅读时间需要 1 分钟。

主要参考:

luasql安装, 在终端通过yum命令安装:

yum -y install lua-sql

接下来写个测试的lua脚本文件(通过lua连接mysql数据库),如:

#!/usr/bin/lualocal luasql = require "luasql.mysql"local env = assert(luasql.mysql())local con = assert(env:connect("mysql", "root", "123", "192.168.1.90", 3306))local cur = assert(con:execute("show databases"))local row = cur:fetch ({}, "a") while row do    print(row.Database)    row = cur:fetch (row, "a")endcur:close()con:close()env:close()

运行结果:

[zcm@vm-fedora20 lua]$ ./mysql.lua information_schemamysqlperformance_schemasakilatestworld

 

转载于:https://www.cnblogs.com/joeblackzqq/p/4342158.html

你可能感兴趣的文章
<input type="file"> accept属性筛选文件类型
查看>>
ElementUI 之 DatePicker 日期限制范围 disabledDate
查看>>
ElementUI 之 Message,自动弹出,信息不显示问题
查看>>
Vue IE11 报错 Failed to generate render function:SyntaxError: 缺少标识符 in
查看>>
ElementUI 之 Cascader 级联选择器指定 value label
查看>>
django 渲染模板与 vue 的 {{ }} 冲突解决方法
查看>>
随手写一个获取验证码倒计时的效果
查看>>
vue3.0中的双向数据绑定方法
查看>>
Laravel图片上传出现 symlink (): Input/output error 解决方案
查看>>
Debian终端乱码解决办法
查看>>
Mac下Vim编辑快捷键小结
查看>>
CF1178E Archaeology
查看>>
CF1179B Tolik and His Uncle
查看>>
CF787D Legacy
查看>>
CF1175F The Number of Subpermutations
查看>>
CF1208F Bits And Pieces
查看>>
CF1208C Magic Grid
查看>>
CF1208D Restore Permutation
查看>>
CF1172B Nauuo and Circle
查看>>
CF1178D Prime Graph
查看>>