1

When in the Python shell I type:

import MySQLdb
Con = MySQLdb.Connect(user='testuser', password='password', db='test')

And I get this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Nickey\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\__init__.py", line 86, in Connect
    return Connection(*args, **kwargs)
  File "C:\Users\Nickey\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, <NULL>)

And no description of the error at all. Please, I am waiting for help. Thanks.

UPDATE: In case somebody will be having this problem, it appears to be connected with the new mysql_auth_plugin, with its new Strong Password Encryption for Authentication. I just switched to old_password_plugin(Legacy Authentication Method) in the configuration of MySQL Server and now [All works!].

1 Answer 1

2

According to the docs, password is not a keyword argument like you entered, instead it's passwd as you can see --> here

Sign up to request clarification or add additional context in comments.

1 Comment

I have changed keyword argument to passwd and got the same result. Actually, if i type just Con = MySQLdb.Connect() without any argument I get the same OperationalError(2059, <NULL>)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.