Modify ↓
Opened 18 years ago
Closed 18 years ago
#5216 closed defect (duplicate)
Developer at USI Inc, Mongolia
Reported by: | ochirkhuyag | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.10.3 |
Severity: | normal | Keywords: | installation, mysql |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It cannot be installed on mysql database with unicode character set. Trace is below.
Creating and Initializing Project Failed to create environment. (1071, 'Specified key was too long; max key length is 1000 bytes') Traceback (most recent call last): File "/var/lib/python-support/python2.5/trac/scripts/admin.py", line 613, in do_initenv options=options) File "/var/lib/python-support/python2.5/trac/env.py", line 124, in __init__ self.create(options) File "/var/lib/python-support/python2.5/trac/env.py", line 229, in create DatabaseManager(self).init_db() File "/var/lib/python-support/python2.5/trac/db/api.py", line 69, in init_db connector.init_db(**args) File "/var/lib/python-support/python2.5/trac/db/mysql_backend.py", line 50, in init_db cursor.execute(stmt) File "/var/lib/python-support/python2.5/trac/db/util.py", line 51, in execute return self.cursor.execute(sql) File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 164, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes') Unicode characters are 3 bytes in MySQL, so mysql_backend.py line 61 should be "limit = '''333''' / len(columns)", not limit = '''500''' / len(columns)
This bug is encountered when i was installing Trac on unicode mysql database.
MySQL database creation command was:
create database tracdb character set utf8 collate utf8_general_ci;
After above fix, it is installed with no errors.
Attachments (0)
Change History (1)
comment:1 by , 18 years ago
Description: | modified (diff) |
---|---|
Milestone: | 0.11 |
Resolution: | → duplicate |
Status: | new → closed |
Version: | 0.10-stable → 0.10.3 |
Note:
See TracTickets
for help on using tickets.
You probably didn't use the latest of the 0.10-stable branch, but rather 0.10.3, as this bug (#3676) was somehow fixed in the now released 0.10.4 version.
I say somehow because the fix is only limited to the workaround you described and some more tweaks for the key length for the specific case of the
node_change
table, but it should be good enough unless you have very long paths.See MySqlDb for more information on MySQL support for Trac.