I need to use Python to connect to a database that uses the mysql_old_password authentication plugin. I do not have db admin access so I cannot change this setting, so please do not suggest that.
I just installed the MySQLdb module, downloaded here. Other stackoverflow questions on this matter have led me to believe that it is possible to use the old authentication with this module, but when I set up my connection (db info removed for privacy reasons), I get the following error:
('Unexpected error:', <class '_mysql_exceptions.OperationalError'>)
Traceback (most recent call last):
File "convert_db.py", line 48, in <module>
main()
File "convert_db.py", line 25, in main
prod_con = MySQLdb.connect('xxxx', 'xxxx', 'xxxx', 'xxxx')
File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/Library/Python/2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, "Authentication plugin 'mysql_old_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/mysql_old_password.so, 2): image not found")
This seems to indicate that I just need to download the plugin image from somewhere - is this possible? Or is there some field I can set using MySQLdb that will allow me to connect?