1

I'm using a Dragino LG01 gateway which is running a Linux system. I want to connect the gateway to a MySQL database (using XAMPP). There is a tutorial for doing this but I am still having problems.

When I try to test the script by running the

lua linkmysql.lua

command I get the following error

lua: linkmysql.lua:7: LuaSQL: error connecting to database. MySQL:
Can't connect to local MySQL server through socket '/tmp' (146)

closed as unclear what you're asking by Rui F Ribeiro, msp9011, Mr Shunz, teppic, X Tian Apr 17 at 12:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • in your lua file can you tell it to connect to TCP/IP at 127.0.0.1 ? Alternatively, set the correct location for the socket if mysql is configured to listen in that fashion. in short, confirm where mysql is listening. confirm in your .lua file it is pointing to the right spot. – ivanivan Apr 14 at 17:29
  • If you are using a tcp connection and you are using localhost, then try 127.0.0.1 instead (yes, it's crazy). See Can't connect to local MySQL server. – Freddy Apr 14 at 17:36

Browse other questions tagged or ask your own question.