Error:
Require ' luasql.mysql '
Stdin:1: module ' luasql.mysql ' not found:
No field package.preload[' Luasql.mysql ']
No file '/usr/local/share/lua/5.3/luasql/mysql.lua '
No file '/usr/local/share/lua/5.3/luasql/mysql/init.lua '
No file '/usr/local/lib/lua/5.3/luasql/mysql.lua '
No file '/usr/local/lib/lua/5.3/luasql/mysql/init.lua '
No file './luasql/mysql.lua '
No file './luasql/mysql/init.lua '
No file '/usr/local/lib/lua/5.3/luasql/mysql.so '
No file '/usr/local/lib/lua/5.3/loadall.so '
No file './luasql/mysql.so '
No file '/usr/local/lib/lua/5.3/luasql.so '
No file '/usr/local/lib/lua/5.3/loadall.so '
No file './luasql.so '
Stack Traceback:
[C]: in function ' require '
Stdin:1: in main chunk
[C]: in?
Environment: Ubuntu installed LUA, no MySQL installed
Solution Solutions
First, install MySQL
Installing MySQL on Ubuntu is very simple and requires just a few commands to complete.
1. sudo apt-get install Mysql-server
2. Apt-get Isntall mysql-client
3. sudo apt-get install Libmysqlclient-dev
Reference links
Http://www.linuxidc.com/Linux/2016-07/133128.htm
Two -install luasql-mysql
Luarocks Install luasql-MySQL
Reference link http://www.runoob.com/lua/lua-database-access.html
Three installation Luasql-mysql error
Error:could not find header file for MYSQL
No file Mysql.h in/usr/local/mysql
The your system and/or pass Mysql_dir or Mysql_incdir to the Luarocks command.
Example:luarocks Install Luasql-mysql mysql_dir=/usr/local
Workaround:
Execute Whereis MySQL in terminal to find the include path of MySQL
Luarocks Install Luasql-mysql Mysql_incdir=/usr/include/mysql
Note: Configure the path to the mysql.h you have found
Luarocks error require ' luasql.mysql ' report module ' Luasql.mysql ' not found: