MySQL Forums
Forum List  »  Oracle

Can't Connect To MySQL Local Database From Local Node App
Posted by: Kon Tiki
Date: November 18, 2021 12:50PM

CONSOLE OUTPUT
==============

[nodemon] starting `node app.js`
HTTP Server for NodeApp started at port 3000
We're in to the back end of NodeApp !
Someone has POSTed data to the Node server ...
URL trimmed endpoint: reg-user
Input Value: tamjk
In router.js now ...
Endpoint: reg-user Data: tamjk
Handler: authen.js
In handler authen.js now ...
Mode: reg Field: user Value: tamjk
In format validation now ...
Format Validation Message: Valid format
Connecting to user-data database checking user ...
In MySQL Query script now ...
Query: SELECT user FROM users WHERE user = 'tamjk'
Router returned message undefined
Callback Message: undefined
Message: undefined
Sent back response: undefined
_http_outgoing.js:696
throw new ERR_INVALID_ARG_TYPE('first argument',
^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer or Uint8Array. Received undefined
at write_ (_http_outgoing.js:696:11)
at ServerResponse.write (_http_outgoing.js:661:15)
at reqCallback (/home/sandbar/Desktop/nodeapp-local/app.js:116:6)
at IncomingMessage.<anonymous> (/home/sandbar/Desktop/nodeapp-local/app.js:87:10)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
[nodemon] app crashed - waiting for file changes before starting...

Options: ReplyQuote


Subject
Views
Written By
Posted
Can't Connect To MySQL Local Database From Local Node App
1002
November 18, 2021 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.