2

I have been performing a mysql migration from 4.0.24 to 5.6.12 and was actually done with a python script to transfer the data when a lovely update to mysql broke my authentication to the old server.

I am using a mac os x 10.8.5. previous versions of mysql via brew were 5.5.27, 5.5.28, 5.5.29, & 5.6.12. I had issues with a previous use permissions and ended up blowing all those away (after making a copy of /usr/local). Now all I have is mysql 5.6.13... I was able to re-install 5.6.12 via commit, but the 5.5.* versions(files) are no longer available via mysql.com through brew.

So the error I am getting is this:

machine:folder user$ python migrate.py
Traceback (most recent call last):
......
    return DBH( params )
  File "dbh.py", line 32, in __init__
    db=self.params.get('db')
  File "/Volumes/Data/Users/user/.virtualenvs/migrate/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/Volumes/Data/Users/user/.virtualenvs/migrate/lib/python2.7/site-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2049, "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)")

Keep in mind I did install mysql-python via pip; and have tried both 1.2.3 and 1.2.4 (no other version available)

and I am using virtualenvwrapper with site packages included... also tried to use pip with different versions over mysql-python

I am not that familiar with the mac OS yet, so i am not exactly sure how one of these packages exactly plays off of each other... my best guess is that brew install mysql is both the server and client libraries, and services; and that the local pip install mysql-python only extends off of the brew install... then the virtualenv would overwrite the local mysql-python install. If this is incorrect please let me know and explain if possible, might help me out too.

I did find the following links, but ultimately did not help:

  • mysql-error-1064 (this looked like it was heading in the right direction, but did not explain how to implement it specifically.

any clues? Thank you very much in advance.

Community
  • 1
  • 1
Chris H.
  • 21
  • 4

1 Answers1

3

Versions of MySQL since 5.6.7 have secure_auth enabled by default, which means that a 5.6.7+ client won't allow you to connect if your MySQL user password is hashed using the pre-4.1 method. You said you are migrating from a 4.0.24 installation, so your MySQL user password is definitely hashed using the pre-4.1 method.

When using the mysql command-line tool, you can get around this and connect to your pre-4.1 database by using the --skip-secure-auth command line option. For example:

mysql -h 127.0.0.1 -u username -p --skip-secure-auth

Unfortunately there's no way to disable secure_auth in mysql-python.

sjs
  • 8,830
  • 3
  • 19
  • 19