Docunext


Trac with MySQL

November 13th, 2007

I've decided to give it a try - Trac with MySQL:

apt-get install trac

I already have MySQL installed.

apt-get install python-mysqldb

I tried doing the trac-admin initenv test-trac/ before setting up the database, username and password, but that didn't work so I had to start over. After that, it was really quite easy. I got an error:

/var/lib/python-support/python2.4/trac/db/util.py:50:
Warning: Incorrect string value: '\xD0\xBF\xD0\xB5\xD1\x80...' for column 'text' at row 0

But I think that its OK. The database configuration ended up in the trac-env/conf/trac.ini, and it appears that it won't be too tough to convert an existing SQLite database. I'm not ready to do that quite yet, just wanted to take the first step today.

To set this up with a failover, I'll need to use either SQL-Relay or a proxy server for Apache, because I don't know how to use a conditional for the trac settings in trac.ini. I'll probably use SQL Relay as I've been meaning to do that for awhile, and I imagine using Apache's proxy capabilities might be problematic due to authentication.

UPDATE December 2, 2007: I setup another trac / mysql test and it worked! The database connection string is along these lines:

mysql://username:password@hostname:port/databasename

I was also able to convert an existing sqlite database to a MySQL database. I did this one manually, but will likely do the next one using a script. So far, so good!

¥

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022