错误:

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 ?

环境: ubuntu 已安装lua,未安装mysql

解决方案

一、先安装mysql

Ubuntu上安装MySQL非常简单只需要几条命令就可以完成。

1. sudo apt-get install mysql-server

2. apt-get isntall mysql-client

3.  sudo apt-get install libmysqlclient-dev

参考链接

http://www.linuxidc.com/Linux/2016-07/133128.htm

二 安装luasql-mysql

luarocks install luasql-mysql

参考链接 http://www.runoob.com/lua/lua-database-access.html

三 安装luasql-mysql 出错

Error: Could not find header file for MYSQL
No file mysql.h in /usr/local/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

解决方法:

在终端执行whereis mysql 找到mysql 的include路径

luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql

注释:配置自己查到的mysql.h 所在路径

luarocks错误 require ‘luasql.mysql' 报module 'luasql.mysql' not found:的更多相关文章

  1. mysql报错“Starting MySQL...The server quit without updating PID file”处理

    http://blog.csdn.net/lzq123_1/article/details/51354179 注意:要将/usr/bin/mysql_install_db替换成 /usr/bin/my ...

  2. 可视化工具连接mysql报1862【mysql修改登录密码】

    1862是密码被修改了. 修改方法: 1.以root登录账户: 账户与密码都是root mysql -uroot -proot 2.修改密码 set password = password('1234 ...

  3. win7下安装MYSQL报错:"MYSQL 服务无法启动"的3534问题

    上午在win7下安装MYSQL,只到“net start mysql”这一步报错:3534的错误: 于是在百度中搜索关键字“mysql服务无法启动3534”. 参考以下两个链接中的方法,解决了3534 ...

  4. 【mysql报错】MySQL host is blocked because of many connection errors; 解决方法

    MySQL host is blocked because of many connection errors; 报错 环境 操作系统:Linux 数据库:mysql5.7.27 错误提示 jHost ...

  5. linux启动mysql报错 Starting MySQL... ERROR! The server quit without updating PID file (XXXX pid文件位置)

    最近在云服务器上安装mysql  启动时报错了,从错误中可以看出,定位在pid文件上,有三种解决方案 1.重启服务器:因为服务器更新时,可能会禁用某些守护进程,重启后即可恢复 2.删除配置文件,重启试 ...

  6. mysql报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    一.问题 运行java代码时报如下的错误: You have an error in your SQL syntax;Cause:com.mysql.jdbc.exceptions.jdbc4.MyS ...

  7. Java连接MySql报错—— com.mysql.cj.exceptions.InvalidConnectionAttributeException

    详细报错 java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents mor ...

  8. mysql报错问题解决MySQL server PID file could not be found!

    MySQL server PID file could not be found! 无法启动mysql服务 # service mysqld start MySQL server PID file c ...

  9. MySql报错(持续更新)

    目录 MySql报错 1. 重复键报错1062- duplicate entry '0' for key 'xxx' 1.1 报错场景 1.2 报错原因 1.3 解决方法 1.4 具体举例 2. VS ...

随机推荐

  1. python oop面向对象笔记

    #coding:utf-8 class Person(object): def __init__(self,name,wage): self.name = name self.wage = wage ...

  2. spring in action第一章小结1

    1 spring基本理念是简化java开发. 使用以下4个策略简化java开发 1) 基于POJO的轻量级和最小侵入性编程 2)通过使用DI和AOP实现松耦合 3)基于切面和惯例进行声明式编程 4)通 ...

  3. yii xss模型安全

    在这篇文章里,我们将描述一个基于WEB应用下避免不合法的内容注入. 我们要在一个行为里使用htmlpurifier类,用这种行为可以加强任何模型并表明各属性我们想让它们XSS安全. 我写了以下行为: ...

  4. 当 ftp 遇上 http Proxy

    在asp.net 开发中,有时需要使用到ftp 上传文件, 如果客户电脑使用http proxy 上网, 那么,客户电脑在使用ftp上传文件时,可能会出现以下错误: 使用 HTTP Proxy 時,不 ...

  5. 图片onerror事件,为图片加载指定默认图片

    为图片指定加载失败时显示默认图片,js输出的img对象,onerror是事件,不是属性,所以这样写是不起作用的: var img = $(document.createElement("IM ...

  6. atitit.破解 拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结

    atitit.破解  拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结 1. 自动获取手机短信方式的原理 1 2. 调用api 1 3. ----核心代码 2 4.  ...

  7. [css]margin-top重叠

  8. Action的mapping.findFoward(forwardName)必须要在struts-config.xml中的对应的action节点配置一个forward节点

    比如说你有个SampleAction,在execute(ActionMapping mapping, ...)中写了句 return mapping.findForward("some_pa ...

  9. flask学习笔记(-操作数据库)

    Python 数据库框架 大多数的数据库引擎都有对应的 Python 包,包括开源包和商业包.Flask 并不限制你使用何种类型的数据库包,因此可以根据自己的喜好选择使用 MySQL.Postgres ...

  10. MySQL5.7的配置文件

    5.7  /etc/mysql/mysql.conf.d/mysqld.cnf 5.6  /etc/my.cnf  或  /etc/mysql/my.cnf