MySQL use unix socket in Django settings
Django docs suggest "HOST" field hackery, but there's much cleaner way:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
# ...
"OPTIONS": {
"unix_socket": "/tmp/mysql-dev.sock",
}
}
}
Written by Mark Vasilkov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#