diff --git a/memsql/common/database.py b/memsql/common/database.py index 3510a17..d4e4fcf 100644 --- a/memsql/common/database.py +++ b/memsql/common/database.py @@ -1,6 +1,7 @@ """A lightweight wrapper around _mysql.""" from MySQLdb import _mysql +import MySQLdb import time import operator @@ -55,6 +56,13 @@ def __init__(self, host, port=3306, database="information_schema", user=None, pa assert isinstance(options, dict), "Options to database.Connection must be an dictionary of { str: value } pairs." args.update(options) + # Fix for parameter name changes in mysqlclient v2.1.0 + if MySQLdb.version_info[:2] >= (2, 1): + if "db" in args: + args["database"] = args.pop("db") + if "passwd" in args: + args["password"] = args.pop("passwd") + self._db = None self._db_args = args diff --git a/setup.py b/setup.py index fcbf909..1615248 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ 'wraptor', 'simplejson', 'python-dateutil<3.0', - 'mysqlclient<2.0', + 'mysqlclient>=1.4', ] class PyTest(TestCommand):