登录“ ER_NO_DEFAULT_FOR_FIELD”时,节点应用未发送任何数据,

时间:2019-05-10 19:01:00

标签: node.js

我正在使用不同的域名将节点应用程序从一台服务器转移到另一台服务器。 我已经设置了所有内容,但是无法登录到创建的应用程序的控制面板,出现以下错误。

{ Error: ER_NO_DEFAULT_FOR_FIELD: Field 'origin' doesn't have a default value
at Query.Sequence._packetToError (/var/www/node/node_modules/mysql/lib/pro                                                                   tocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/var/www/node/node_modules/mysql/lib/protocol/sequen                                                                   ces/Query.js:77:18)
at Protocol._parsePacket (/var/www/node/node_modules/mysql/lib/protocol/Pr                                                                   otocol.js:278:23)
at Parser.write (/var/www/node/node_modules/mysql/lib/protocol/Parser.js:7                                                                   6:12)
at Protocol.write (/var/www/node/node_modules/mysql/lib/protocol/Protocol.                                                                   js:38:16)
at Socket.<anonymous> (/var/www/node/node_modules/mysql/lib/Connection.js:                                                                   91:28)
at Socket.<anonymous> (/var/www/node/node_modules/mysql/lib/Connection.js:                                                                   502:10)
at Socket.emit (events.js:189:13)
at Socket.EventEmitter.emit (domain.js:441:20)
at addChunk (_stream_readable.js:284:12)
at readableAddChunk (_stream_readable.js:265:11)
at Socket.Readable.push (_stream_readable.js:220:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
--------------------
at Protocol._enqueue (/var/www/node/anode_modules/mysql/lib/protocol/Protoc                                                                   ol.js:144:48)
at Connection.query (/var/www/node/node_modules/mysql/lib/Connection.js:20                                                                   0:25)
at Object.managerLogin (/var/www/node/node_modules/login/index.js:58:15)
at callbackFunction (/var/www/node/routes/index.js:62:16)
at Layer.handle [as handle_request] (/var/www/node/node_modules/express/lib/router/                                                                   layer.js:95:5)
at next (/var/www/node/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/www/node/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/www/node/node_modules/express/lib/router/                                                                   layer.js:95:5)
at /var/www/node/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/www/node/node_modules/express/lib/router/index.js:                                                                   330:12)
at next (/var/www/node/node_modules/express/lib/router/index.js:271:10)
at /var/www/node/app.js:55:7
at Layer.handle [as handle_request] (/var/www/node/node_modules/express/lib/router/                                                                   layer.js:95:5)
at trim_prefix (/var/www/node/node_modules/express/lib/router/index.js:312:13)
at /var/www/node/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/var/www/node/node_modules/express/lib/router/index.js:                                                                   330:12)

代码:“ ER_NO_DEFAULT_FOR_FIELD”,   errno:1364,   sqlMessage:“字段\'origin \'没有默认值”,   sqlState:“ HY000”,   索引:0,   sql:    'INSERT INTO userLog SET userId = 2,token = \'9d99a1a0-7350-11e9-9671-95abec1f75f6 \',ip = \'\',browser = \'\',isLog = \'y \',isValid = \'y \''}

无法弄清这是怎么回事,因为应用程序正在旧服务器中运行文件。

1 个答案:

答案 0 :(得分:0)

对其进行了调试,发现它是一个mysql错误,使用[mysqld] port = 3306 sql-mode=""编辑了etc / mysql / my.cnf 重新加载了mysql,它对我有用!