Luarocks error require ' luasql.mysql ' report module ' Luasql.mysql ' not found:

Source: Internet
Author: User
Tags mysql in stdin

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.