Changes between Version 77 and Version 78 of MySqlDb
- Timestamp:
- Apr 19, 2022, 7:29:53 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MySqlDb
v77 v78 3 3 = MySQL and its MySQLdb Python bindings 4 4 5 Trac supports the [http://mysql.com MySQL] database backend, although there are a couple of [#KnownIssues]. MySQL is fully 6 integrated in our test suite. 5 Trac supports the [http://mysql.com MySQL] database backend, although there are a couple of [#KnownIssues]. MySQL is fully integrated in Trac's test suite. 7 6 8 7 == Requirements 9 8 === MySQL 10 9 11 The recommended versions of MySQL are those from 5.x series .10 The recommended versions of MySQL are those from 5.x series and above. 12 11 13 The following MySQL drop in replacements are also known to work:12 The following MySQL drop-in replacements are also known to work: 14 13 * The [http://askmonty.org/wiki/index.php/MariaDB MariaDB] variant: 15 14 - tested MariaDB 5.3.3, MySQLdb 1.2.3 and Trac 0.12.3 … … 18 17 - tested Percona 5.6 with Trac 1.1.4 19 18 20 In order to avoid Unicode and international characters problems in Trac, eg international characters turning into question marks with mysterious **"Incorrect string value"** errors logged, the Trac database '''must''' be configuredwith one of the following character set and collation type pairs:19 To avoid Unicode and international character conflicts in Trac, such as international characters turning into question marks with mysterious **"Incorrect string value"** errors logged, the Trac database '''must''' be configured with one of the following character set and collation type pairs: 21 20 * `utf8` / `utf8_bin` 22 21 * `utf8mb4` / `utf8mb4_bin` … … 37 36 }}} 38 37 39 To check character set settings for your database, issue the following commands:38 To check the character set settings for your database, issue the following commands: 40 39 {{{#!sql 41 40 mysql> USE trac; … … 93 92 The recommended version is [pypi:MySQL-python MySQL-python 1.2.2+], which must be compiled in ''thread-safe client'' mode. Earlier versions are known to be problematic. 94 93 95 The [pypi:MySQL-python MySQL-python] page on PyPI contains links to the `.tar.gz` source distribution.94 The [pypi:MySQL-python] page on PyPI contains links to the `.tar.gz` source distribution. 96 95 97 96 For Windows, there are several possibilities: 98 97 - the PyPI page mentioned above also links to pre-built Windows eggs, but for Python 2.7 32-bits only. 99 - Python binaries (32-bits and 64-bits) can be found at codegood.com [http://www.codegood.com/archives/4 for Python 2.6] and [http://www.codegood.com/archives/129 for Python 2.7]; however they have been last updated in 2010, so it only proposes version 1.2.3, which should however work fine100 - recentPython 2.7 wheels (32-bits and 64-bits) can be found in the [http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python Unofficial Windows Binaries for Python Extension Packages], kindly provided by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.98 - Python binaries (32-bits and 64-bits) can be found at codegood.com [http://www.codegood.com/archives/4 for Python 2.6] and [http://www.codegood.com/archives/129 for Python 2.7]; these have been last updated in 2010, so it only proposes version 1.2.3, which should however work fine. 99 - Python 2.7 wheels (32-bits and 64-bits) can be found in the [http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python Unofficial Windows Binaries for Python Extension Packages], kindly provided by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine. 101 100 - if you are using ActiveState Python 2.6 on Windows, you can install with `pypm install mysql-python` 102 - last but not least, the [http://conda.pydata.org/docs/ Conda] project also contains recent versions of this package and it's handy for use by continuous integration systems as the package can be installed non-interactively using a simple `conda install -qy mysql-python` command (32-bits and 64-bits)101 - the [https://docs.conda.io/en/latest/ Conda] project also contains recent versions of this package and it's handy for use by continuous integration systems as the package can be installed non-interactively using the command `conda install -qy mysql-python` (32-bits and 64-bits). 103 102 104 103 On FreeBSD this package is called {{{py-MySQLdb}}} in [http://www.freshports.org/databases/py-MySQLdb55/ the ports collection]. 105 104 106 107 105 ==== Thread-safety is important 108 106 109 You should make sure that you 're using a thread-safe version of the bindings.107 You should make sure that you are using a thread-safe version of the bindings. 110 108 To verify this, you can check the ''System Information'' section in the ''About Trac'' page, when you are logged with a user having the `CONFIG_VIEW` or the `TRAC_ADMIN` permission. 111 109 You should see a line reading: '''MySQL''' `server: "...", client: "...", thread-safe: 1`. … … 120 118 ==== Convert from MyISAM to InnoDB storage engine 121 119 122 InnoDB is the default storage engine for MySQL since v5.5, but older databases may be defined using MyISAM. 123 Check which tables are not already converted: 120 InnoDB is the default storage engine for since MySQL v5.5, but older databases may still use MyISAM. Check which tables use an unsupported storage engine: 124 121 {{{#!sql 125 122 SELECT table_name, engine FROM information_schema.tables WHERE table_schema = DATABASE();