title: OperationalError while connecting django and mysql
body: <p>I have a problem connecting the mysql database with django. I have already tried to find solutions on the internet but nothing helped me. When I change the code in the 'setting.py' file and then enter 'python manage.py migrate' in the console:</p>
  
  <pre><code>(blog) PS C:\Users\kacpe\Dev\blog\blog\blog&gt; python manage.py migrate                                                   Traceback (most recent call last):
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 217, in ensure_connection
      self.connect()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 195, in connect
      self.connection = self.get_new_connection(conn_params)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\mysql\base.py", line 227, in get_new_connection
      return Database.connect(**conn_params)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
      return Connection(*args, **kwargs)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\MySQLdb\connections.py", line 166, in __init__
      super(Connection, self).__init__(*args, **kwargs2)
  MySQLdb._exceptions.OperationalError: (2059, &lt;NULL&gt;)
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "manage.py", line 21, in &lt;module&gt;
      main()
    File "manage.py", line 17, in main
      execute_from_command_line(sys.argv)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
      utility.execute()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\__init__.py", line 375, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
      self.execute(*args, **cmd_options)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\base.py", line 361, in execute
      self.check()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\base.py", line 387, in check
      all_issues = self._run_checks(
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\management\commands\migrate.py", line 64, in _run_checks
      issues = run_checks(tags=[Tags.database])
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks
      new_errors = check(app_configs=app_configs)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\core\checks\database.py", line 10, in check_database_backends
      issues.extend(conn.validation.check(**kwargs))
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\mysql\validation.py", line 9, in check
      issues.extend(self._check_sql_mode(**kwargs))
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\mysql\validation.py", line 13, in _check_sql_mode
      with self.connection.cursor() as cursor:
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 256, in cursor
      return self._cursor()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 233, in _cursor
      self.ensure_connection()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 217, in ensure_connection
      self.connect()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\utils.py", line 89, in __exit__
      raise dj_exc_value.with_traceback(traceback) from exc_value
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 217, in ensure_connection
      self.connect()
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\base\base.py", line 195, in connect
      self.connection = self.get_new_connection(conn_params)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\django\db\backends\mysql\base.py", line 227, in get_new_connection
      return Database.connect(**conn_params)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
      return Connection(*args, **kwargs)
    File "C:\Users\kacpe\Dev\blog\blog\lib\site-packages\MySQLdb\connections.py", line 166, in __init__
      super(Connection, self).__init__(*args, **kwargs2)
  django.db.utils.OperationalError: (2059, &lt;NULL&gt;)
  </code></pre>
  
  <p>It's frustrating because I can't fix it and I'm just starting to learn Django. Thank you in advance for your help.</p>
  
  <p>My Database code from 'setting.py':</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'blog',
          'USER': 'Shiraga',
          'PASSWORD': 'MYPASSWORD',
          'HOST': '127.0.0.1',
          'PORT': '3306',
      }
  }
  </code></pre>