node.js报错throw err; // Rethrow non-MySQL errors e:\serverTest\node_modules\mysql\lib\protocol\Parser.js:79 解决方法
今天在用node+angular做后台时,需要使用session保存登陆状态的时候,遇到了此问题,问题直译为非mysql问题,我也在后台取到的登陆用户名和密码,确实不是数据库问题。最后发现在使用session时报的错,但session配置没有问题,最终发现是node主文件配置顺序出了问题。
app.configure(function() {
app.use(cookie());
app.use(session({
name: "severTest",
secret: "1234567",
cookie: {maxAge: 10000}, //过期时间 毫秒为单位
resave: true, //每次触发后保存时间
rolling: true // 最后一次触发后计时
}));
});
app.use(app.router); //将路由级别提升最先,必须要写在设置静态资源配置之前
设置路由之前必须先进行express配置,完后重启服务器就ok了。
node.js报错throw err; // Rethrow non-MySQL errors e:\serverTest\node_modules\mysql\lib\protocol\Parser.js:79 解决方法的更多相关文章
- phpize命令在安装AMQP插件是报错phpize:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF envir的解决方法
phpize命令在安装AMQP插件是报错phpize:Cannot find autoconf. Please check your autoconf installation and the $PH ...
- manjaro软件源报错 不停看到错误 "PackageName: signature from "User <email@archlinux.org>" is invalid" 的几种解决方法
对于报错情况, 格式大致如下: error: PackageName: signature from "User <email@archlinux.org>" is i ...
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...
- for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法
一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...
- 报错 BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext 的解决方法
这个普遍是因为tomcat 的 jar包问题,重新导入一下tomcat的jar包就OK了.
- WIN10 报错 "此共享需要过时的SMB1协议,而此协议是不安全"的解决方法
发现新安装的win10能看到其他计算机,但不能共享其他计算的共享文件/夹,出现如下情况:在浏览器里输入:\IP 不能访问到计算机的共享文件夹,或者在桌面上新建一个指向到其他计算机共享文件/夹的快捷方式 ...
- 不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方window.alert=function(aa){ if (typeof (aa)"undefined"){ throw "就是这";}};
不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方 var oldalert=window.alert; window.alert=function(aa){ i ...
- npm install 报错:node-pre-gyp ERR! 问题解决
npm install报错问题解决 问题: E:\CodeSpace\GitlabTest\desktop>npm install > lifeccp-desktop@1.1.9 post ...
- cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,
1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://reg ...
随机推荐
- spring MVC cors跨域实现源码解析
# spring MVC cors跨域实现源码解析 > 名词解释:跨域资源共享(Cross-Origin Resource Sharing) 简单说就是只要协议.IP.http方法任意一个不同就 ...
- oracle_数据库访问问题
1.通过JDBC连接数据库时报错“Caused by: oracle.net.ns.NetException: Got minus one from a read call” 网上百度得到: 1:数据 ...
- Java用自定义的类型作为HashMap的key
需要重写hashCode()和equals()方法才可以实现自定义键在HashMap中的查找. public class PhoneNumber { private int prefix; //区 ...
- IP查询接口1
新浪的:http://counter.sina.com.cn/ip?ip=IP地址返回Js数据,感觉不是很精确,可以把问号后面的去掉,直接返回本机对应的IP所在地http://www.yodao.co ...
- 《经久不衰的Spring框架:SpringMVC 统括》
前言:经久不衰的Spring 这几年,前端技术更新换代速度之快,每一年"最火的前端技术"排行榜都会换一番场景,本当に信じかねる.是"只闻新人笑不见旧人哭",还是 ...
- Javascript的简单测试环境
在<JavaScript忍者秘籍>2.4测试条件基础知识中,作者给出了一个精简版的assert和assert组的实现,对于初学者而言,这无疑是一个很好的例子,既让我们得到了一个好用的小工具 ...
- IP数据报格式 及路由转发算法
ip数据报分首部和数据两部分组成: 首部分为固定部分和可变部分 版本--占 4 位,指 IP 协议的版本 目前的 IP 协议版本号为 4 (即 IPv4) 首部长度--占 4 位,可表示的最大数值 是 ...
- bootstrap - btn
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 从C#到TypeScript - 装饰器
总目录 从C#到TypeScript - 类型 从C#到TypeScript - 高级类型 从C#到TypeScript - 变量 从C#到TypeScript - 接口 从C#到TypeScript ...
- JDBC链接mysql数据库
Unit_1 首先:JDBC:java database connectivity SUN公司提供的一套操作数据库的标准规范. JDBC与数据库驱动的关系是接口与实现的关系. JDBC涉及到四个核心的 ...