Ok, one more test, since trac is using MySQLdb I searched the code and
extracted this short test code. And it works:
# python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from trac.util import get_pkginfo
>>> import MySQLdb
>>> import MySQLdb.cursors
>>> mysqldb_version = get_pkginfo(MySQLdb).get('version', MySQLdb.__version__)
>>> print("MySQLdb.version = {}".format(mysqldb_version))
MySQLdb.version = 1.3.7
>>> con = MySQLdb.connect('localhost', 'tracuser', 'thung0hohF6no3ah', 'trac')
>>> cur = con.cursor()
>>> cur.execute("SHOW TABLES")
19L
>>> for (table_name) in cur:
... print("- {}".format(table_name))
...
- ('attachment',)
- ('auth_cookie',)
- ('cache',)
- ('component',)
- ('enum',)
- ('milestone',)
- ('node_change',)
- ('permission',)
- ('report',)
- ('repository',)
- ('revision',)
- ('session',)
- ('session_attribute',)
- ('system',)
- ('ticket',)
- ('ticket_change',)
- ('ticket_custom',)
- ('version',)
- ('wiki',)
>>> cur.close()
>>> con.close()
>>> quit()
Am 12.11.2017 um 16:55 schrieb Chris Shelton:
Are you sure that you have python 2.7 installed? I believe that starting with
Ubuntu server 16.04.1, the default python version is set to 3.5, not 2.7. Trac
still requires 2.7.x. Try running:
python --version
to see what version of python that you are using.
If you are using the 3.5 branch of python, you will very likely need to install
python 2.7 for trac to work:
sudo apt-get install python2.7
should work to start installing python 2.7.
chris
On Sun, Nov 12, 2017 at 9:41 AM, Torge Riedel <torgerie...@gmx.de
<mailto:torgerie...@gmx.de>> wrote:
Am 11.11.2017 um 11:44 schrieb Torge Riedel:
Hi,
I've set up a new server Ubuntu 16.04.3 LTS and try to migrate my
existing (and running) trac 1.0.13 installation to 1.2.2, but this fails with
TracError: Unsupported database type "mysql"
Setting up a new environment with the same connection string gives me:
Failed to create environment.
Unsupported database type "mysql"
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/admin/console.py", line 500,
in do_initenv
options=options)
File "build/bdist.linux-x86_64/egg/trac/core.py", line 136, in
__call__
self.__init__(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/trac/env.py", line 300, in __init__
self.create(options)
File "build/bdist.linux-x86_64/egg/trac/env.py", line 592, in create
DatabaseManager(self).init_db()
File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 337, in
init_db
connector, args = self.get_connector()
File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 615, in
get_connector
scheme=scheme))
TracError: Unsupported database type "mysql"
So I think it is an environment/installation issue. I need help to
point me to the right direction to find the cause. The python-mysqldb package
is installed. But to be honest I'm not a python developer, so no idea from my
site how to dig deeper in the code to find the root cause.
Thanks in advance
Torge
Ok, this switched to a general issue. I followed documentation on
https://trac.edgewall.org/wiki/TracInstall
<https://trac.edgewall.org/wiki/TracInstall> and then the following call to
initialize a new environment:
trac-admin /var/www/trac/env2 initenv
Creating a new Trac environment at /var/www/trac/env2
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]> Test
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 existing MySQL or
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
Database connection string [sqlite:db/trac.db]>
mysql://tracuser:MyPwd@localhost:3306/trac
Creating and Initializing Project
Initenv for '/var/www/trac/env2' failed.
Failed to create environment.
Unsupported database type "mysql"
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/admin/console.py", line 500, in
do_initenv
options=options)
File "build/bdist.linux-x86_64/egg/trac/core.py", line 136, in __call__
self.__init__(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/trac/env.py", line 300, in __init__
self.create(options)
File "build/bdist.linux-x86_64/egg/trac/env.py", line 592, in create
DatabaseManager(self).init_db()
File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 337, in init_db
connector, args = self.get_connector()
File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 615, in
get_connector
scheme=scheme))
TracError: Unsupported database type "mysql"
Looks no good. I checked the following:
- mysql -utracuser -p > giving the same password results in a successful login,
db "trac" can be shown and tables too
- php -m shows following output
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
- apt-get install python-mysqldb displays
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-mysqldb is already the newest version (1.3.7-1build2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Any ideas what to check further.
Thanks in advance
Torge
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to trac-users+unsubscr...@googlegroups.com
<mailto:trac-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to trac-users@googlegroups.com
<mailto:trac-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/trac-users
<https://groups.google.com/group/trac-users>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
trac-users+unsubscr...@googlegroups.com
<mailto:trac-users+unsubscr...@googlegroups.com>.
To post to this group, send email to trac-users@googlegroups.com
<mailto:trac-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.