pythonmysqldjangoheidisql

MySQL ERROR 1045 (28000): Access denied for user


I want to connect to a readonly MySQL-DB to my Django WebAPP. Using Django, MySQL-Workbench or MySQL-Shell always resulted in the same error:

ERROR 1045 (28000): Access denied for user 'db-foo-read'@'125.67.891.26' (using password: YES)

I was able to connect via HeidiSQL-Client using the same configurations, but only if the library is set to libmysql-6.1.dll enter image description here

Choosing a different .dll always resulted in the same Error 1045 (28000) : Access denied...

Django Database Settings:

'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'db-foo',
    'USER': 'db-foo-read',
    'PASSWORD': 'djlkwajldljwj1ldwa1',
    'HOST': '125.67.891.26',
    'PORT': '3306',
},

What i tried:


Solution

  • Solution was downgrading the mysql version to support old the tls-protocol versions 1.1 and 1.2

    Also adding the parameter

    --tls-version="TLSv1.1,TLSv1.2"
    

    to the command seems to fixed the Issue. Reason was that the DB was using an old Version of MongoDB which only supported these old protocols.

    For anyone having the same Issue, here's a table of all MySQL-Versions with the supported tls protocols: https://dev.mysql.com/doc/refman/8.0/en/encrypted-connection-protocols-ciphers.html