Django can simply connect to its own MySQL server by setting HOST
and PORT
in settings.py
as \'\' (empty string):
DATA
By default, Debian-based distros configure MySQL to bind to localhost only, which means that other hosts cannot connect to it. Fix your MySQL configuration and it will work.
Edit /etc/mysql/my.cnf
and change this line:
bind-address = 127.0.0.1
To this:
bind-address = 0.0.0.0
This will expose MySQL to all network interfaces, so make sure that you have security measures in place if this server is exposed to untrusted hosts.