diff -r 87e906f2ad2d site-packages/mysql/connector/django/base.py --- a/site-packages/mysql/connector/django/base.py Wed Jul 09 08:06:52 2014 -0400 +++ b/site-packages/mysql/connector/django/base.py Wed Jul 09 08:35:43 2014 -0400 @@ -389,7 +389,7 @@ raise ValueError( "MySQL backend does not support timezone-aware times." ) - return self.connection.connection.converter._datetime_to_mysql(value) + return self.connection.cached_converter._datetime_to_mysql(value) def value_to_db_time(self, value): if not value: @@ -400,7 +400,7 @@ raise ValueError("MySQL backend does not support timezone-aware " "times.") - return self.connection.connection.converter._time_to_mysql(value) + return self.connection.cached_converter._time_to_mysql(value) def year_lookup_bounds(self, value): # Again, no microseconds @@ -462,14 +462,20 @@ self.server_version = None # Since some features depend on the MySQL version, we need to connect - self._connect() + try: + self._connect() - self.features = DatabaseFeatures(self) - self.ops = DatabaseOperations(self) - self.client = DatabaseClient(self) - self.creation = DatabaseCreation(self) - self.introspection = DatabaseIntrospection(self) - self.validation = DatabaseValidation(self) + self.features = DatabaseFeatures(self) + self.ops = DatabaseOperations(self) + self.client = DatabaseClient(self) + self.creation = DatabaseCreation(self) + self.introspection = DatabaseIntrospection(self) + self.validation = DatabaseValidation(self) + + # Cache the converter to be used by DatabaseOperations + self.cached_converter = self.connection.converter + finally: + self.close() def _valid_connection(self): if self.connection: