title: Django + XAMPP on Mac (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
body: <p>I am following <a href="https://www.youtube.com/watch?v=D6esTdOLXh4" rel="nofollow noreferrer">this</a> tutorial to build a Django app with MySQL. </p>
  
  <p>I am using XAMPP-VM for Mac. I set up my Database settings for Django as so:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'djangoproject',
          'USER': 'root',
          'PASSWORD': '',
          'HOST': 'localhost',
          'PORT': '8080',
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I have started MySQL on XAMPP but when I run python manage.py migrate I get:</p>
  
  <blockquote>
    <p>django.db.utils.OperationalError: (2002, "Can't connect to local MySQL
    server through socket '/tmp/mysql.sock' (2)")</p>
  </blockquote>
  
  <p>Thank you for your help!</p>