chill117 / express-mysql-session

A MySQL session store for the express framework in node
MIT License
313 stars 108 forks source link

First time running `npm test` and it failed. See log link below #55

Closed c0debreaker closed 7 years ago

c0debreaker commented 7 years ago

https://gist.github.com/c0debreaker/c7288c87b1db8c0e5d60ee7f8ee2e3d5

Here are few lines copied from the output

1) clear(cb) "before all" hook:
   Error: ER_BAD_DB_ERROR: Unknown database 'session_test'
  at Handshake.Sequence._packetToError (node_modules/mysql/lib/protocol/sequences/Sequence.js:51:14)
  at Handshake.ErrorPacket (node_modules/mysql/lib/protocol/sequences/Handshake.js:103:18)
  at Protocol._parsePacket (node_modules/mysql/lib/protocol/Protocol.js:280:23)
  at Parser.write (node_modules/mysql/lib/protocol/Parser.js:74:12)
  at Protocol.write (node_modules/mysql/lib/protocol/Protocol.js:39:16)
  at Socket.<anonymous> (node_modules/mysql/lib/Connection.js:109:28)
  at readableAddChunk (_stream_readable.js:176:18)
  at Socket.Readable.push (_stream_readable.js:134:10)
  at TCP.onread (net.js:548:20)

    --------------------
  at Protocol._enqueue (node_modules/mysql/lib/protocol/Protocol.js:141:48)
  at Protocol.handshake (node_modules/mysql/lib/protocol/Protocol.js:52:41)
  at PoolConnection.connect (node_modules/mysql/lib/Connection.js:136:18)
  at Pool.getConnection (node_modules/mysql/lib/Pool.js:48:16)
  at Pool.query (node_modules/mysql/lib/Pool.js:200:8)
  at MySQLStore.<anonymous> (lib/index.js:103:20)
  at tryToString (fs.js:455:3)
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:12)
c0debreaker commented 7 years ago

I got it working after manually running

mysql> create database session_test;

I believe this mysql command has to be mentioned in the readme.md

chill117 commented 7 years ago

@c0debreaker It is mentioned here. It says that you need to setup the MySQL database and specifies the default test MySQL configurations.

c0debreaker commented 7 years ago

Thanks!