1

I'm part of a project and trying to make sure that our Lua code can interact with a given MySQL-database which I only have remote access to.

This causes problems when trying to install LuaSQL (through luarocks), giving the following error message:

"Error: Could not find expected file mysql.h, or mysql.h for MYSQL -- you may have to install MYSQL in your system and/or pass MYSQL_DIR or MYSQL_INCDIR to the luarocks command. Example: luarocks install luasql-mysql MYSQL_DIR=/usr/local"

I tried attaching the hostname, "MYSQL_DIR"="MySQLHostName" without any success.

Worth noting is the absence of anything MySQL-related on my local system. Do I need to install something of that kind? I am obviously not interested in a local server.

Edit: After recommendation I installed MySQL locally, and tried to proceed. I then got one step further, but faced problems with the command line not interpreting 'cl'. Running CMD as admin solved that.

Current state: Still missing files for the installation, despite doing the local installation of MySQL. No longer missing "mysql.h" but rather "string.h" and "winsock32.h" which I have no clue what they are.

Joel
  • 21
  • 7
  • you can use odbc. it did not require any external deps on windows. you just need install odbc driver for mysql – moteus Oct 06 '15 at 14:10

1 Answers1

0

You need the MySQL libraries to build LuaSQL. You can get them by either installing MySQL Community Server for Windows, or; alternatively, downloading the ZIP packages, extracting it and browsing to the include/ directory in the package.

The include/ directory contains all inkers and headers etc. sources for MySQL. It is this directory's path that is to be passed for MYSQL_INCDIR argument.

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
  • Thank you for you response. Naturally more, unrelated, problems arise. The installation script requires "cl" to be in the PATH. I am unable to find cl.exe in my system unless I enter: "C:\Users\usr\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin" which I believe is related to an old Python project. Putting that in the path just gives a different error message, saying "cannot open include file: 'string.h': No such file or directory. Indeed I also cannot find that file when browsing my include-directory. – Joel Oct 06 '15 at 11:19
  • run something like `VC command prompt`. checkout VC menu in start menu. – moteus Oct 06 '15 at 14:08
  • I'm not really sure what to make out of your suggestion, you may have to dumb it down/extend the answer a bit more. I'm not very well versed when it comes to this. – Joel Oct 06 '15 at 17:26