Ticket #1528: mysql_base_encoding.diff
File mysql_base_encoding.diff, 1.6 KB (added by , 19 years ago) |
---|
-
django/conf/global_settings.py
83 83 DATABASE_PASSWORD = '' # Not used with sqlite3. 84 84 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. 85 85 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. 86 DATABASE_CHARSET = 'utf8' # Used with MySQL 4.1.x and higher 86 87 87 88 # Host for sending e-mail. 88 89 EMAIL_HOST = 'localhost' -
django/core/db/backends/mysql.py
53 53 self.queries = [] 54 54 55 55 def cursor(self): 56 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, D EBUG56 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DATABASE_CHARSET, DEBUG 57 57 if self.connection is None: 58 58 kwargs = { 59 59 'user': DATABASE_USER, … … 67 67 self.connection = Database.connect(**kwargs) 68 68 cursor = self.connection.cursor() 69 69 if self.connection.get_server_info() >= '4.1': 70 cursor.execute("SET NAMES utf8")70 cursor.execute("SET NAMES %s" % DATABASE_CHARSET) 71 71 if DEBUG: 72 72 return base.CursorDebugWrapper(MysqlDebugWrapper(cursor), self) 73 73 return cursor