I have builded a trac project which runs normally with the default database sqlite.
But now I want to use Mysql to surpport trac.
So I installed the Mysql and create a database for trac.
I want to build a new trac project.And I did as the follow,but there is error.
I'm using:
trac V0.11.1
python V2.4.4
Mysql V5.0.67
MySQL_python-1.2.2-py2.4-win32.egg
C:\Python24\Scripts>trac-admin c:\test1215 initenv
Creating a new Trac environment at c:\test1215
Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.
Please enter the name of your project.
This name will be used in page titles and descriptions.
Project Name [My Project]> test1215;
Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
Database connection string [sqlite:db/trac.db]> mysql://lingminhu:******@localho
st:3306/test1215
Please specify the type of version control system,
By default, it will be svn.
If you don't want to use Trac with version control integration,
choose the default here and don't specify a repository directory.
in the next question.
Repository type [svn]> svn
Please specify the absolute path to the version control
repository, or leave it blank to use Trac without a repository.
You can also set the repository location later.
Path to repository [/path/to/repos]> C:\test1215\svn
Creating and Initializing Project
Initenv for 'c:\test1215' failed.
Failed to create environment.
(1050, "Table 'system' already exists")
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\trac\admin\console.py", line 568, in do_in
itenv
options=options)
File "C:\Python24\Lib\site-packages\trac\env.py", line 188, in __init__
self.create(options)
File "C:\Python24\Lib\site-packages\trac\env.py", line 311, in create
DatabaseManager(self).init_db()
File "C:\Python24\Lib\site-packages\trac\db\api.py", line 70, in init_db
connector.init_db(**args)
File "C:\Python24\Lib\site-packages\trac\db\mysql_backend.py", line 90, in ini
t_db
cursor.execute(stmt)
File "C:\Python24\lib\site-packages\mysql_python-1.2.2-py2.4-win32.egg\MySQLdb
\cursors.py", line 166, in execute
File "C:\Python24\lib\site-packages\mysql_python-1.2.2-py2.4-win32.egg\MySQLdb
\connections.py", line 35, in defaulterrorhandler
OperationalError: (1050, "Table 'system' already exists")
Initenv for 'c:\test1215' failed.
1
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\trac\admin\console.py", line 573, in do_in
itenv
sys.exit(1)
SystemExit: 1
It sounds like you're using a database that's already been initialized with the Trac tables. This is a configuration issue. See #5138 and others like it.