Michael Manoochehri
Michael Manoochehri

Reputation: 7877

Python/SQLAlchemy: Connecting to a MySQL instance with Cleartext Authentication enabled

I'd like to access a MySQL server which is setup in a way that only allows mysql_clear_password. I am able to connect to using command like, with the --enable-cleartext-plugin option, like so:

>> mysql --port NNN -u my_user -h DB.host.com --enable-cleartext-plugin -D my_database

However, from Python (specifically using SQLAlchemy/PyMySQL) It doesn't seem possible to use the enable-cleartext-plugin option. How can we optionally pass this information via Python?

Upvotes: 2

Views: 2856

Answers (1)

Topher
Topher

Reputation: 86

I believe there's no need to do anything special, and it has worked for me. When connecting to the DB, the server asks the client to use the plugin mysql_clear_password, and PyMySQL already understands how to handle that.

Upvotes: 1

Related Questions