Cool Smith
2018-12-06 11:46:34 UTC
Hi everyone,
I am new to Django. I have started a new project running on my localhost.
Rather than using the default sqlite database, I changed it to mysql with
the following settings on MacOS High Sierra v13.10.6:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mysql',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '',
'PORT': '5432'
}
}
Enter code here...
When I run the server using the
python manage.py runserver
command, I get an error:
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL
server through socket '/tmp/mysql.sock' (2)")
Does anyone know the cause of this error and tell me how to fix it? Thank
you in advance.
I am new to Django. I have started a new project running on my localhost.
Rather than using the default sqlite database, I changed it to mysql with
the following settings on MacOS High Sierra v13.10.6:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mysql',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '',
'PORT': '5432'
}
}
Enter code here...
When I run the server using the
python manage.py runserver
command, I get an error:
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL
server through socket '/tmp/mysql.sock' (2)")
Does anyone know the cause of this error and tell me how to fix it? Thank
you in advance.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f1386271-01f7-4909-887a-f7efa008bcef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f1386271-01f7-4909-887a-f7efa008bcef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.