Database Connection Failing on Upgrade to 4.2.7

django.db.backends.mysql is the official one (embedded in django) but it requires a mysqldb API driver (see Databases | Django documentation | Django).

mysqlclient is one of this DB API driver. As there is no wheel on pypi for it (except for windows), pip needs to build the wheel from sources, hence the error you encoutered. In order to be able to build it you have to install some devel packages (see documentation at mysqlclient · PyPI)

However, django documentation also mention mysql-python-connector (Databases | Django documentation | Django) but it states that “It may not support the most recent releases of Django”. This is the case for the version you installed (8.0.23) as the DatabseWrapper does not have a mysql_server_data attribute.

If you want to stick with using mysql-python-connector, you must at least install version 8.0.26, which added the missing property. However, I cannot guarantee that there won’t be any other issues after that. You may consider upgrading to an even more recent version of the lib.

VERY helpful!

Thank you.

I grabbed the latest version and suddenly - everything boots up and runs.