Index: trac/db/mysql_backend.py
===================================================================
--- trac/db/mysql_backend.py	(revision 3549)
+++ trac/db/mysql_backend.py	(working copy)
@@ -56,11 +56,14 @@
         
         Some Versions of MySQL limit each index prefix to 500 bytes total, with
         a max of 255 bytes per column.
+
+	1000 bytes was the limit for mine, but for utf8 charset that means 4 bytes
+        per character.  So I brought it down to 250
         """
         cols = []
-        limit = 500 / len(columns)
-        if limit > 255:
-            limit = 255
+        limit = 250 / len(columns)
+        if limit > 250:
+            limit = 250
         for c in columns:
             name = '`%s`' % c
             table_col = filter((lambda x: x.name == c), table.columns)
@@ -85,7 +88,7 @@
         if len(table.key) > 0:
             coldefs.append('    PRIMARY KEY (%s)' %
                            self._collist(table, table.key))
-        sql.append(',\n'.join(coldefs) + '\n)')
+        sql.append(',\n'.join(coldefs) + '\n) DEFAULT CHARSET=utf8')
         yield '\n'.join(sql)
 
         for index in table.indices:
@@ -116,6 +119,8 @@
         vers = tuple([ int(n) for n in cnx.get_server_info().split('.')[:2] ])
         if vers < (4, 1):
             raise TracError, 'MySQL servers older than 4.1 are not supported!'
+        cnx.query('SET CHARACTER SET UTF8');
+        cnx.store_result()
         cnx.query('SET NAMES %s' % charset)
         cnx.store_result()
         cnx.charset = charset
