我在树莓皮上有一个MySQL Db,IP:192.168.100.230。
我有一个NodeMCU (ESP8266) IP:192.168.100.150。
raspberry pi MySQL有以下用于开发的数据库:
Database: pythonProg
User: pythonUser
Pass: password123
Table: espTest
我试图让ESP8266使用LUA将一个温度(Integer)记录到Pi上的数据库中。
我必须测试连接的代码是:
-- Script to test the connection to a MySQL Db
mysql = require
我尝试使用tarantool作为应用服务器,并希望从tarantool连接到mysql。
在lua中,我编写了一个函数:
local function mysql_data(query, limit)
local conn = mysql.connect({host = mysql_host, user = mysql_user, password = mysql_password, db = mysql_database})
local tuples = conn:execute(query, limit)
return tuples
end
但在日志中我看到:
我一直在使用openresty lua,并尝试连接到在本地主机上运行的mysql数据库。但是,我无法连接到它,也无法对其进行调试,因为lua mysql客户端没有提供任何有关该错误的信息。
--
-- Created by IntelliJ IDEA.
-- User: AGK
-- Date: 6/5/18
-- Time: 2:14 PM
-- To change this template use File | Settings | File Templates.
--
local mysql = require "resty.mysql"
local _M=
我正在使用redis和mysql为openresty项目,我试图用init_worker_by_lua初始化数据库,但我收到了下面的错误。
我的db.lua代码:
local mysql = require("resty.mysql") -- Introduce mysql
local redis = require("resty.redis") -- Introduce Redis
local db, err = mysql:new()
if not db
我在这个问题上已经困了一个多星期了。我想在ubuntu16.04中安装mysql代理。我首先下载了源代码,并使用./autogen.sh生成Makefile。但我知道错误是:
tests/unit/Makefile.am:97: warning: source file
'$(top_srcdir)/src/network_mysqld_type.c' is in a subdirectory,
tests/unit/Makefile.am:97: but option 'subdir-objects' is disabled
我试图添加
我想在init_by_lua_block或init_worker_by_lua_block中创建到Tarantool数据库的连接,然后在每个content_by_lua_block中使用创建的连接
init_by_lua_block {
local tnt = require 'resty.tarantool'
local tar, err = tnt:new({
host = '127.0.0.1',
port = 3312,
user = 'user',
pas
我需要从pdns中的Lua脚本中读取一个数据库表--在一个科学Linux 6.4服务器上进行递归,该服务器随Lua预加载而来。
显然,我必须使用luarocks来安装luasql。当我试图安装luasql时,我得到:
Checking Lua includes... lua.h not found
lua.h is not on the server.
我试着删除已安装的版本,这样我就可以从二进制文件中安装了,但是这就破坏了系统,它显然使用了所有安装的Lua (yum、rpm等)。现在我必须重新加载操作系统。如何从嵌入式Lua获得MySQL访问?
提前谢谢。
我下载了mysql-async,essentialmode,esplugin_mysql,es_admin2,async,它显示了这个错误。 是关于什么的?请帮助我,我正在尝试创建我的服务器。 [ERROR] connect ETIMEDOUT
Connecting: kworthbati
Sending heartbeat to live-internal.fivem.net:30110
[ERROR] [MySQL] [esplugin_mysql] An error happens on MySQL for query
"SELECT
我需要从lua脚本中的.conf文件加载配置变量,并使用这些变量连接到数据库。我尝试过使用: require "host.conf"
loadfile("host.conf") - error with unexpected token '#'
os.execute("pathToConfFile/host.lua") - and I have created a lua host file with variables in bash shell
io.popen("host.conf") etc.. 这些解
我正在尝试将mysql-proxy-0.8.4.tar.gz编译并打包到rpm中。我按照说明来构建
[root@localhost mysql-proxy]# rpmbuild -ta --clean mysql-proxy-0.8.4.tar.gz
我得到了这个错误
checking which pkg-config file to use to find Lua... configure: error: MySQL Proxy can't be built using --without-lua, lua 5.1 is required
error: Bad exit status
我刚刚下载了mysql-proxy并创建了这个脚本lua (可以在Mysql文档中找到):
function read_query(packet)
if string.byte(packet) == proxy.COM_QUERY then
print("QUERY: " .. string.sub(packet, 2))
end
end
这是我正在使用的命令行:
mysql-proxy -P localhost:1234 -b localhost:3306 --proxy-lua-script=profile.lua --plugins=proxy
当