#986: MySQL database support
----------------------------+-----------------------------------------------
Reporter: anonymous | Owner: cmlenz
Type: enhancement | Status: closed
Priority: high | Milestone: 0.10
Component: general | Version: devel
Severity: major | Resolution: fixed
Keywords: database mysql |
----------------------------+-----------------------------------------------
Comment (by [EMAIL PROTECTED]):
None of the solutions for the collation problem above worked on my MySQL
install. I eventually figured out a fix for it. All that is needed is to
change the default charset for each table to utf8.
You can do this by hand, "ALTER TABLE..." or you can do as I did and do
mysqldump -a tracdb > tracdb.sql
edit this file to change the charset in each table creation to DEFAULT
CHARSET=utf8;
Also you will need to change the indexes to smaller sizes as utf8 is ?? (4
I think) bytes wide and you cannot have indexes larger than 1000 (on mine)
In the mysql_backend.py the comments say 500 bytes.
Once you have made these changes do a
mysql tracdb < tracdb.sql
That is for existing installs.
Here are the changes that make this work for new installs.
change this
{{{
sql.append(',\n'.join(coldefs) + '\n)')
}}}
to
{{{
sql.append(',\n'.join(coldefs) + '\n) DEFAULT CHARSET=utf8')
}}}
and this
{{{
limit = 500 / len(columns)
if limit > 255:
limit = 255
}}}
to this
{{{
limit = 250 / len(columns)
if limit > 250:
limit = 250
}}}
and just in case I changed this
{{{
if vers < (4, 1):
raise TracError, 'MySQL servers older than 4.1 are not
supported!'
cnx.query('SET NAMES %s' % charset)
cnx.store_result()
cnx.charset = charset
}}}
to this
{{{
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
}}}
--
Ticket URL: <http://trac.edgewall.org/ticket/986>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets