I am new to Django and mysql and I am trying to configure my django application's backend to mysql. I am using XAMPP for my local mysql database and anaconda as my pkg manager. Also using a conda virtualenv.
When I go to run python3 manage.py migrate
, I get this error:
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (61)")
My database is setup as the following:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'exampleproject',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '',
}
}
I changed 'HOST' to 'localhost' but then get this error:
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
Any help is appreciated!