After much trial / error, the problem was reduced to passwords using the old encryption style.
mysql> select User, Password from mysql.user; | user1 | *113D91F3A36D29C287C457A20D602FA384B8569F | | user2 | 5d78f2535e56dfe0 |
Tools like Navicat do not automatically use the new style passwords, and you must explicitly tell it not to use the old style (in Navicat, which is called Advanced / Use OLD_PASSWORD tncryption) - this is where we worked.
If you are using mysql shell you can just use
mysql> update mysql.user set password=PASSWORD("NEWPASSWORD") where User='testuser'; Query OK, 1 row affected Rows matched: 1 Changed: 1 Warnings: 0 mysql> select User, Password from mysql.user WHERE user = 'testuser'; | testuser | *B845F78DCA29B8AE945AB9CFFAC24A9D17EB5063 |
If you want to find all the users affected by this issue,
mysql> SELECT Host, User, Password FROM mysql.user WHERE LENGTH(Password) = 16;
Some versions of Django do not allow secure-auth to be used inside parameters, but for those that you can use;
'OPTIONS': { 'secure-auth': False }
If it is not supported, this will result in:
TypeError: 'secure-auth' is an invalid keyword argument for this function
This, I hope, will serve as a quick answer for those who are experiencing problems in the future.