title: Unable to authenticate mongoDB
body: <p>From the mongo client it looks like I can authenticate:</p>
  
  <pre><code>&gt; use admin
  switched to db admin
  &gt; db.auth('admin','SECRETPASSWORD');
  1
  &gt;
  </code></pre>
  
  <p>But when I am trying to connect in my config file in codeigniter with this code</p>
  
  <pre><code>$config['mongo_server'] = null;
  $config['mongo_dbname'] = 'admin';
  $config['mongo_db']['active'] = 'default';
  
  $config['mongo_db']['default']['no_auth'] = FALSE;
  $config['mongo_db']['default']['hostname'] = 'localhost';
  $config['mongo_db']['default']['port'] = '27017';
  $config['mongo_db']['default']['username'] = 'admin';
  $config['mongo_db']['default']['password'] = 'SECRETPASSWORD';
  $config['mongo_db']['default']['database'] = 'mydb';
  $config['mongo_db']['default']['db_debug'] = TRUE;
  $config['mongo_db']['default']['return_as'] = 'array';
  $config['mongo_db']['default']['write_concerns'] = (int)1;
  $config['mongo_db']['default']['journal'] = TRUE;
  $config['mongo_db']['default']['read_preference'] = NULL;
  $config['mongo_db']['default']['read_preference_tags'] = NULL;
  
  $config['mongo_db']['default']['no_auth'] = FALSE;
  $config['mongo_db']['test']['hostname'] = 'localhost';
  $config['mongo_db']['test']['port'] = '27017';
  $config['mongo_db']['test']['username'] = '';
  $config['mongo_db']['test']['password'] = '';
  $config['mongo_db']['test']['database'] = '';
  $config['mongo_db']['test']['db_debug'] = TRUE;
  $config['mongo_db']['test']['return_as'] = 'array';
  $config['mongo_db']['test']['write_concerns'] = (int)1;
  $config['mongo_db']['test']['journal'] = TRUE;
  $config['mongo_db']['test']['read_preference'] = NULL;
  $config['mongo_db']['test']['read_preference_tags'] = NULL;
  </code></pre>
  
  <p>I am getting this error </p>
  
  <pre><code>Unable to connect to MongoDB: Failed to connect to: localhost:27017: Authentication failed on database 'mydb' with username 'admin': auth failed
  </code></pre>