To work around this "'HOST': '127.0.0.1'," has to be set in "DATABASES" in
"settings.py"
--
Ticket URL: <https://code.djangoproject.com/ticket/30088>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Simon Charette):
Not sure what's the issue here, setting `'HOST': '127.0.0.1'` in
`DATABASES[alias]` should be required to connect using to localhost though
TCP. Why you do consider it a workaround?
In other words, what would you expect `DATABASES` to be set to in order to
connect to your localhost MySQL instance through a TCP socket?
--
Ticket URL: <https://code.djangoproject.com/ticket/30088#comment:1>
* status: new => closed
* resolution: => needsinfo
* component: Uncategorized => Database layer (models, ORM)
* type: Uncategorized => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/30088#comment:2>
* status: closed => new
* resolution: needsinfo =>
Comment:
I would expect not to need to set `HOST` in `DATABASES` since
`host=127.0.0.1` is already set in `my.cfg`. Django does not honor
`127.0.0.1` in `my.cfg` and tries to connect using a UNIX socket instead
of TCP.
--
Ticket URL: <https://code.djangoproject.com/ticket/30088#comment:3>
* status: new => closed
* resolution: => invalid
Comment:
Hi,
Django is not doing anything in particular here. The underlying library
used is `mysqlclient`, and that itself uses the MySQL C bindings, which
has some default behaviour around checking configuration files. I think it
differs slightly from the MySQL command line and the `my.cfg` file may not
be checked.
If you still consider this a problem, try checking for similar issues in
mysqlclient or reporting it there: https://github.com/PyMySQL/mysqlclient-
python . But they are quite conservative as a project, so I'd say it's
unlikely anything will be done.
Thanks,
Adam
--
Ticket URL: <https://code.djangoproject.com/ticket/30088#comment:4>