Connect to a MySQL Database on the LAN using LUA on ESP8266 -
i have mysql db on raspberry pi, ip:192.168.100.230.
have nodemcu (esp8266) ip:192.168.100.150.
raspberry pi mysql has following database used development:
database: pythonprog user: pythonuser pass: password123 table: esptest
i trying esp8266 log temperature (integer) database on pi using lua.
the code have test connection is:
-- script test connection mysql db mysql = require "luasql.mysql" local env = mysql.mysql() local conn = env:connect('pythonprog','pythonuser'@'192.168.100.230','password123') print(env,conn)
the error is
mysql_test1.lua:4: ')' expected near '@'
there little information out there on these little devices, assistance appreciated. thanks.
that connection string should without quotes:
env:connect('pythonprog','pythonuser@192.168.100.230','password123')
or, if really want keep '@' separated ;-) (don't this)
'pythonuser'..'@'..'192.168.100.230'