title: ER_BAD_DB_ERROR on connecting to database using Sequelize
body: <p>I have a project that utilizes the npm packages mysql, Sequelize and redis.</p>
  
  <p>The following goes well:</p>
  
  <pre><code>app.use(express.session({
    store: new RedisStore({
      host: 'localhost',
      port: 6379,
      db:   2,
      pass: 'RedisPASS'
    }),
    secret: 'secret' // changed this value of course
  }));
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>Sequelize.connection = new Sequelize('test_ddb',
    'root', 'root', { logging: false });
  </code></pre>
  
  <p>Which throws the following error:</p>
  
  <pre><code>Error: ER_BAD_DB_ERROR: Unknown database 'test_ddb'
  </code></pre>
  
  <p>I tried a couple of things, first I thought Sequelize is not connecting to MAMP's mysql but the my system's mysql, but I had all the symlinks already setup. Like so:</p>
  
  <pre><code>/var/mysql/mysql.sock -&gt; /Applications/MAMP/tmp/mysql/mysql.sock
  </code></pre>
  
  <p>I even changed it here:</p>
  
  <pre><code>/usr/local/mysql/bin/mysql -&gt; /Applications/MAMP/Library/bin/mysql
  </code></pre>
  
  <p>The mysql command in the terminal also utilizes the MAMP database.</p>