title: MySQL Community Server 8.0.16 - django.db.utils.OperationalError: (1045, "Access denied for user (using password: YES)")
body: <p>I'm using Django2.2 with Python3 and MySQL8.0.16 to build out an ETL engine. I have the correct login information for my MySQL instance configured in my Django <strong>settings.py</strong> file. I know this data is correct because I have tested it to manually log in to MySQL from the CLI. I am having trouble with connecting to the MySQL instance from Django and the <strong>'user'</strong> field in the error log does not match up with any users I have configured on my MySQL instance. As a matter of fact, the <strong>'user'</strong> field in the error log is actually the user on the UNIX system on my corporate issued laptop.</p>
  
  <p>I have already setup a user, <strong>john</strong>, to have access to the following tables: (note: I want to use <em>production_tab</em> once I can actually connect).</p>
  
  <pre><code>mysql&gt; show databases;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | production_tab     |
  | mysql              |
  | performance_schema |
  | sys                |
  +--------------------+
  </code></pre>
  
  <p>I'm on a corporate issued Macbook so I can't change the default user on my UNIX system:</p>
  
  <pre><code>➜  project git:(master) ✗ dscl . list /Users | tail -5
  my_corporate_username
  root
  </code></pre>
  
  <p>I've tried looking into the MySQL users to further diagnose the issue and it looks like <em>my_corporate_username</em> is not a registered user (which is intended) and the username I had setup, <strong>john</strong> is registered with a password that explicitly matches my <strong>settings.py</strong> file:</p>
  
  <pre><code>mysql&gt; SELECT user,authentication_string,plugin,host FROM mysql.user;
  +------------------+------------------------------------------------------------------------+-----------------------+-----------+
  | user             | authentication_string                                                  | plugin                | host      |
  +------------------+------------------------------------------------------------------------+-----------------------+-----------+
  | my_corporate_username           | XXXXXXXXXXX~OY7XYXYXHVSrQjUXYXYXYXXTbx/I.oXYXXYYkiCJ0XYXYXXo7yDLGI7 | caching_sha2_password | localhost |
  | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
  | mysql.session    | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
  | mysql.sys        | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
  | root             | *59A3E0XXXXXXXXXXXXXXXE093F493462XXXXXXXX                              | mysql_native_password | localhost |
  +------------------+------------------------------------------------------------------------+-----------------------+-----------+
  </code></pre>
  
  <p>In my <strong>settings.py</strong> file I have the correct credentials that allowed me to query the <strong>show databases;</strong> in the first place which has me really confused as to why (i) I cannot connect to MySQL through the correct login credentials that allow me to login through the CLI and (ii) why I am getting the following error when I run <strong>python3 manage.py runserver</strong>:</p>
  
  <pre><code>django.db.utils.OperationalError: (1045, "Access denied for user 'my_corporate_username'@'localhost' (using password: YES)")
  </code></pre>
  
  <p>My <strong>settings.py</strong> file:</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'john',
          'PASSWORD': 'passwd',
          'PORT': '3306',
          'HOST': 'localhost',
      }
  }
  </code></pre>
  
  <p>I am inclined to think that some of these issues are happening through some wonky permissions issue that exists in the database itself or maybe some configuration file? That's just my best guess. Thank you for any and all help! Cheers!</p>