[Answer]-_mysql.pyd module is mishandling host name

1đź‘Ť

These are two different hostnames serving two different purposes. The “correcthostname” you supply to Django is the name of the computer that’s running the MySQL server. The “wronghostname.com” in the error message is the name of the client machine that tried to connect to the MySQL server. Or at least what the MySQL server thinks is the client machine name is after doing a reverse IP to name look up. These two names will only be the same if the client and server are running on the same machine.

So there’s no botching of “correcthostname” by _mysql.pyd or anything else. It was able to successfully connect to the MySQL server running on “correcthostname”, as that’s what generated the “Access denied” message. If “wronghostname.com” isn’t the correct name of your client machine (the one running Django) then something is wrong on the MySQL server end.

👤Ross Ridge

Leave a comment