diff --git a/AUTHORS b/AUTHORS index 645913e7c4..fef8e09b75 100644 --- a/AUTHORS +++ b/AUTHORS @@ -151,6 +151,7 @@ answer newbie questions, and generally made Django that much better: serbaut@gmail.com Pete Shinners SmileyChris + smurf@smurf.noris.de sopel Thomas Steinacher nowell strite diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index e7e060e6c2..28c5b1c683 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -98,9 +98,11 @@ class DatabaseWrapper(local): kwargs['port'] = int(settings.DATABASE_PORT) kwargs.update(self.options) self.connection = Database.connect(**kwargs) - cursor = self.connection.cursor() - if self.connection.get_server_info() >= '4.1': - cursor.execute("SET NAMES 'utf8'") + cursor = self.connection.cursor() + if self.connection.get_server_info() >= '4.1': + cursor.execute("SET NAMES 'utf8'") + else: + cursor = self.connection.cursor() if settings.DEBUG: return util.CursorDebugWrapper(MysqlDebugWrapper(cursor), self) return cursor