1

Working on a python app on Mac (Yosemite OSX 10.10) I ran into this issue:

OperationalError: (2049, "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)")

With a bit of research it seemed that my client (that is mysql-python) is using secure auth and the user had a password encrypted in an old style, that is prior to pre-4.1.1.

As I do not have ways to handle things on the DB side I was wondering if there was a workaround or a way to deactivate secure_auth on mysql-python?

2 Answers 2

2

I am adapting the answer from here:

Eventually you have to tell the client who has an old-style password to change it to a new-style password. Old passwords are not secure.

Now, you are getting the error since the client has secure_auth set, but they have an old password. In order to login with the old password, the client must disable secure_auth on the client side. How exactly you do this varies by which client you're using.

Some other workarounds can be found in the MySQL documentation: Client does not support authentication protocol

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

5 Comments

I have seen this answer but there was no resource regarding python so I am back to square one. You are qui right about the user and its old style password but I am not in charge of the DB and cannot do/advocate/suggest this change at all.
If you use MySQL Workbench, in the Manage Server Connections, Connection tab, Advanced sub-tab, you can check the box 'Use the old authentication protocol.' and then it should be working for you
again I am not managing the mysql, I have little liberty on that side, I can merely make calls to the DB through python which uses mysql-python to make the call to the database.
Then according to this, there shouldn't be any way to fix it
Aaw... okay well I will check for the ticket being raised there and see if anything is done on it!
0

I found a cure!

Or rather a workaround. From this post I decided to select slightly older version of MySQL and MySQLdb and this solved the issue.

Here is how I did it:

I had previously installed mysql_python for my python and had the brew version of mysql installed.

I deteleted all of that.

I look for a way to install MySQLdb by looking for it last stable version with the source.

I compiled them (followed the isntructions here), installed them and then I looked for a stable version of MySQL client (MySQL website is the best place for that) and install the 5.5 version which was perfectly fitting my requirements.

I made mysql to launch itself automatically and then restarted my computer (but you can just restart apache) and check that all path were correct and the right includes are in the right places (you can check that against the link above).

And now it all works fine!

Hope it helps.

Comments

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.