I tried starting MYSQL server on System Preferences. However, it seems the server will shutdown automatically a few seconds later.
On Friday, December 7, 2018 at 8:09:28 PM UTC+11, Cool Smith wrote: > > How to do so? > > On Friday, December 7, 2018 at 1:38:09 AM UTC+11, C. Kirby wrote: >> >> Did you start your mysql process? >> >> On Thursday, December 6, 2018 at 9:33:37 AM UTC-5, Cool Smith wrote: >>> >>> 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. >>> >> -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@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/3a69cf5d-101d-4653-87ba-f89c1b2ae956%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.