title: sails-mysql No database Selected
body: <p>I've googled this quite a bit, and looked at other solutions on stack overflow but have found nothing that fixes my issue.  When defining a model to use mysql instead of disk I get the following error</p>
  
  <pre><code>verbose: Registering model `users` in Waterline (ORM) with definition :: 
   { identity: 'users',
    tableName: 'users',
    connections: 
         [ { pool: true,
         connectionLimit: 10,
         waitForConnections: true,
         adapter: 'sails-mysql' } ],
    config: 
     { host: 'localhost',
       port: 3306,
       user: 'root',
       password: 'password',
       database: 'sailsapp' },
    attributes: { name: 'string', email: 'string', phone: 'string' },
    globalId: 'users',
    introduce: [Function: bound],
    obituary: [Function: bound],
    publish: [Function: bound],
    pluralize: [Function],
    room: [Function: bound],
    classRoom: [Function],
    subscribers: [Function],
    publishCreate: [Function: bound],
    publishUpdate: [Function: bound],
    publishDestroy: [Function: bound],
    subscribe: [Function: bound],
    unsubscribe: [Function: bound],
    adapter: [ 'adhoc_adapter_0' ] } 
  
  Logic error in mySQL ORM.
  { [Error: ER_NO_DB_ERROR: No database selected] code: 'ER_NO_DB_ERROR', index: 0 }
  error: Hook failed to load: orm (Error: ER_NO_DB_ERROR: No database selected)
  verbose: Hooks loaded!
  error: Error encountered while loading Sails core!
  error: Error: ER_NO_DB_ERROR: No database selected
  at Query.Sequence._packetToError     (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-    mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:32:14)
  at Query.ErrorPacket (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Query.js:82:18)
  at Protocol._parsePacket (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:172:24)
  at Parser.write (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:62:12)
  at Protocol.write (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:37:16)
  at Socket.ondata (stream.js:51:26)
  at Socket.EventEmitter.emit (events.js:117:20)
  at Socket.&lt;anonymous&gt; (_stream_readable.js:746:14)
  at Socket.EventEmitter.emit (events.js:92:17)
  at emitReadable_ (_stream_readable.js:408:10)
  at emitReadable (_stream_readable.js:404:5)
  at readableAddChunk (_stream_readable.js:165:9)
  at Socket.Readable.push (_stream_readable.js:127:10)
  at TCP.onread (net.js:528:21)
  --------------------
  at Query.Sequence (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:15:20)
  at new Query (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Query.js:12:12)
  at Function.Connection.createQuery (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:48:10)
  at Connection.query (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:100:26)
  at __DESCRIBE__ (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/lib/adapter.js:121:20)
  at afterwards (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/lib/adapter.js:571:7)
  at Handshake._callback (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/Pool.js:37:9)
  at Handshake.Sequence.end (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:66:24)
  at Handshake.Sequence.OkPacket (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:75:8)
  at Protocol._parsePacket (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:172:24)
  at Parser.write (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:62:12)
  at Protocol.write (/home/rich/PhpstormProjects/sailsjs/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:37:16)
  at Socket.ondata (stream.js:51:26)
  at Socket.EventEmitter.emit (events.js:117:20)
  at Socket.&lt;anonymous&gt; (_stream_readable.js:746:14)
  at Socket.EventEmitter.emit (events.js:92:17)
  at emitReadable_ (_stream_readable.js:408:10)
  at emitReadable (_stream_readable.js:404:5)
  at readableAddChunk (_stream_readable.js:165:9)
  at Socket.Readable.push (_stream_readable.js:127:10)
  at TCP.onread (net.js:528:21)
  </code></pre>
  
  <p><br></p>
  
  <p>I have read in other places that there is a known error with the new version of sails.js (0.9.16) where the adapter and config have to be specified for each model.  I have done that as you can see from the error log, however the code for my model is below</p>
  
  <pre><code>module.exports = {
      adapter: 'mysql',
      config: {
          host: 'localhost',
          port: 3306,
          user: 'root',
          password: 'password',
          database: 'sailsapp'
      },
  
      attributes: {
          name: 'string',
          email: 'string',
          phone: 'string'
      }
  };
  </code></pre>
  
  <p>I'm still getting the same error.  Here is the package.json file for my app</p>
  
  <pre><code>{
      "name": "sailsjs",
      "private": true,
      "version": "0.0.0",
      "description": "a Sails application",
      "dependencies": {
          "sails": "0.9.16",
          "grunt": "0.4.1",
          "sails-disk": "~0.9.0",
          "ejs": "0.8.4",
          "optimist": "0.3.4"
      },
      "scripts": {
          "start": "node app.js",
          "debug": "node debug app.js"
      },
      "main": "app.js",
      "repository": "",
      "author": "",
      "license": ""
  }
  </code></pre>
  
  <p>and the package.json file for my version of sails-mysql</p>
  
  <pre><code>{
    "name": "sails-mysql",
    "version": "0.9.9",
    "description": "MySQL adapter for Sails.js",
    "main": "lib/adapter.js",
    "scripts": {
      "test": "make test"
    }, ...
  </code></pre>
  
  <p>Are there any suggestions about how to resolve this issue?</p>