title: Authentication failed on mongodb
body: <p>I've created an user on mongo db this is the comnand and the output</p>
  <pre><code>db.createUser({user:&quot;appuser&quot;,pwd:&quot;12345&quot;,roles: [ { role: &quot;readWrite&quot;, db: &quot;mydb&quot; }]})
  Successfully added user: {
      &quot;user&quot; : &quot;appuser&quot;,
      &quot;roles&quot; : [
          {
              &quot;role&quot; : &quot;readWrite&quot;,
              &quot;db&quot; : &quot;mydb&quot;
          }
      ]
  }
  </code></pre>
  <p>but when I try to enter with this command</p>
  <pre><code>mongo --port 27017 -u &quot;appuser&quot; --authenticationDatabase &quot;mydb&quot; -p
  </code></pre>
  <p>I get this error</p>
  <pre><code>MongoDB shell version v4.4.4
  Enter password: 
  connecting to: mongodb://127.0.0.1:27017/?authSource=mydb&amp;compressors=disabled&amp;gssapiServiceName=mongodb
  Error: Authentication failed. :
  connect@src/mongo/shell/mongo.js:374:17
  @(connect):2:6
  exception: connect failed
  exiting with code 1
  </code></pre>
  <p>I created a root user and setted this option in <code>/etc/mongod.conf</code></p>
  <pre><code>security:
    authorization: enabled
  </code></pre>
  <p>is something wrong?</p>