Category Archives: Node js

Error: ER_DBACCESS_DENIED_ERROR: Access denied for user ”@’localhost’ to database

Sometimes nodejs will throw errors like below Error: ER_DBACCESS_DENIED_ERROR: Access denied for user ”@’localhost’ to database ‘node_db’ at Handshake.Sequence._packetToError (E:\project\vasanthan\node_modules\mysql\lib\protocol\sequences\Sequence.js:52:14) at Handshake.ErrorPacket (E:\project\vasanthan\node_modules\mysql\lib\protocol\sequences\Handshake.js:130:18) at Protocol._parsePacket (E:\project\vasanthan\node_modules\mysql\lib\protocol\Protocol.js:279:23) at Parser.write (E:\project\vasanthan\node_modules\mysql\lib\protocol\Parser.js:76:12) at Protocol.write (E:\project\vasanthan\node_modules\mysql\lib\protocol\Protocol.js:39:16) at Socket. (E:\project\vasanthan\node_modules\mysql\lib\Connection.js:103:28) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) Solution:check the database user name and password.usually this… Read More »

Error: ER_BAD_DB_ERROR: Unknown database In nodejs

Usually the below error will generate because of unknown db name or database is not yet created Error: ER_BAD_DB_ERROR: Unknown database ‘node_dbs’ at Handshake.Sequence._packetToError (E:\project\vasanthan\node_modules\mysql\lib\protocol\sequences\Sequence.js:52:14) at Handshake.ErrorPacket (E:\project\vasanthan\node_modules\mysql\lib\protocol\sequences\Handshake.js:130:18) at Protocol._parsePacket (E:\project\vasanthan\node_modules\mysql\lib\protocol\Protocol.js:279:23) at Parser.write (E:\project\vasanthan\node_modules\mysql\lib\protocol\Parser.js:76:12) at Protocol.write (E:\project\vasanthan\node_modules\mysql\lib\protocol\Protocol.js:39:16) at Socket. (E:\project\vasanthan\node_modules\mysql\lib\Connection.js:103:28) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) Solution:Please check the… Read More »

Features of node js

Asynchronous and Event Driven − All APIs of Node.js library are asynchronous, that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response… Read More »

What is Node js

Node.js is a server-side platform built on Google Chrome’s JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows − Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast and… Read More »

TypeError: “listener” argument must be a function Error in node js eventemitter

while executing the above code it is thowing error-TypeError: “listener” argument must be a function Solution:this is because of the code executing sequence.if we use emit() function at the bottom, then eventemitter.on() and other function should be above.