title: Cannot connect to MongoDB when I specify database name
body: <p>I run MongoDB docker container on my local computer and when I try to connect to MongoDB container without specifying database name, it works fine.<br>
  With following command, I managed to connect to MongoDB.</p>
  <pre><code>$ mongo &quot;mongodb://username@127.0.0.1:27017&quot;
  </code></pre>
  <p>But when I try to connect with database name, it will return following error.</p>
  <pre><code>$ mongo &quot;mongodb://username@127.0.0.1:27017/dbname&quot;
  
  MongoDB shell version v4.2.0
  Enter password: 
  connecting to: mongodb://127.0.0.1:27017/dbname?compressors=disabled&amp;gssapiServiceName=mongodb
  2021-02-25T00:26:09.511+0900 E  QUERY    [js] Error: Authentication failed. :
  connect@src/mongo/shell/mongo.js:341:17
  @(connect):2:6
  2021-02-25T00:26:09.515+0900 F  -        [main] exception: connect failed
  2021-02-25T00:26:09.515+0900 E  -        [main] exiting with code 1
  </code></pre>
  <p>I thought it might be because database doesn't exist yet, so I tried with database which already exist but same result.</p>
  <p>And this is my local environment.<br>
  MacOS version 11.2.1<br>
  MongoDB shell version v4.2.0<br>
  mongo official docker image version 4.0.4<br></p>