Mercurial > p > roundup > code
annotate doc/mysql.txt @ 6150:edbd4bba728a
Add 'is_restore_ok' method
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Fri, 01 May 2020 16:33:05 +0200 |
| parents | e48b039b0ec0 |
| children | c2fd254c9257 |
| rev | line source |
|---|---|
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
1 ============= |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
2 MySQL Backend |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
3 ============= |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
4 |
|
1839
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
5 This notes detail the MySQL backend for the Roundup issue tracker. |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
6 |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
7 |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
8 Prerequisites |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
9 ============= |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
10 |
|
1706
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
11 To use MySQL as the backend for storing roundup data, you also need |
|
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
12 to install: |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
13 |
|
5756
e48b039b0ec0
issue2550966: fix suboptimal links in docs.
John Rouillard <rouilj@ieee.org>
parents:
5610
diff
changeset
|
14 1. MySQL RDBMS 4.0.18 or higher - https://www.mysql.com/. Your MySQL |
|
1839
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
15 installation MUST support InnoDB tables (or Berkeley DB (BDB) tables |
|
3929
a472391156ae
mysql table creation syntax change
Justus Pendleton <jpend@users.sourceforge.net>
parents:
2921
diff
changeset
|
16 if you have no other choice). If you're running < 4.0.18 (but not <4.0) |
|
1913
d929c31a3620
clarified minimum version required for MySQL backend (4.0.16)
Richard Jones <richard@users.sourceforge.net>
parents:
1912
diff
changeset
|
17 then you'll need to use BDB to pass all unit tests. Edit the |
|
d929c31a3620
clarified minimum version required for MySQL backend (4.0.16)
Richard Jones <richard@users.sourceforge.net>
parents:
1912
diff
changeset
|
18 ``roundup/backends/back_mysql.py`` file to enable DBD instead of InnoDB. |
|
5510
e2978ed3b550
update link to new mysqlclient module and recommend update in upgrading.txt
Christof Meerwald <cmeerw@cmeerw.org>
parents:
5137
diff
changeset
|
19 2. Python MySQL interface - https://pypi.org/project/mysqlclient/ |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
20 |
|
5137
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
21 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
22 Other Configuration |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
23 =================== |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
24 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
25 If you are indexing large documents (e.g attached file contents) |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
26 using MySQL, you may need to increase the max_allowed_packet size. |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
27 If you don't you can see the error:: |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
28 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
29 'MySql Server has gone away (2006)' |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
30 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
31 To do this edit /etc/my.conf and change:: |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
32 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
33 [mysqld] |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
34 max_allowed_packet = 1M |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
35 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
36 the 'max_allowed_packet' value from '1M' to '64M' or |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
37 larger. |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
38 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
39 Alternatively you can install an alternate indexer (whoosh, xapian |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
40 etc.) and force the tracker to use it by setting the ``indexer`` |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
41 setting in the tracker's ``config.ini``. |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
42 |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
43 This fix was supplied by telsch. See issue |
|
5610
0df5f9eeefd4
Changed references to http://issues.roundup-tracker.org to https now
John Rouillard <rouilj@ieee.org>
parents:
5510
diff
changeset
|
44 https://issues.roundup-tracker.org/issue2550743 for further info or if |
|
5137
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
45 you are interested in developing a patch to roundup to help work |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
46 around this issue. |
|
98fdc1f98194
issue2550743 - Reindex with MySQL Server failed. It looks like
John Rouillard <rouilj@ieee.org>
parents:
4557
diff
changeset
|
47 |
|
1706
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
48 Running the MySQL tests |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
49 ======================= |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
50 |
|
1706
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
51 Roundup tests expect an empty MySQL database. Two alternate ways to provide |
|
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
52 this: |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
53 |
|
1839
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
54 1. If you have root permissions on the MySQL server, you can create |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
55 the necessary database entries using the follwing SQL sequence. Use |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
56 ``mysql`` on the command line to enter:: |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
57 |
|
1839
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
58 CREATE DATABASE rounduptest; |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
59 USE rounduptest; |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
60 GRANT ALL PRIVILEGES ON rounduptest.* TO rounduptest@localhost |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
61 IDENTIFIED BY 'rounduptest'; |
|
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
62 FLUSH PRIVILEGES; |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
63 |
|
1839
06f5b36b201b
Fix a couple of failures in mysql backend unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
1706
diff
changeset
|
64 2. If your administrator has provided you with database connection info, |
|
4513
6a32a2fb95b4
Docs update for mysql and postgresl: Mentioned test/db_test_base.py because
Bernhard Reiter <Bernhard.Reiter@intevation.de>
parents:
3929
diff
changeset
|
65 see the config values in 'test/db_test_base.py' |
|
6a32a2fb95b4
Docs update for mysql and postgresl: Mentioned test/db_test_base.py because
Bernhard Reiter <Bernhard.Reiter@intevation.de>
parents:
3929
diff
changeset
|
66 about which database connection, name and user will be used. |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
67 |
| 2409 | 68 The MySQL database should not contain any tables. Tests will not |
|
1706
5a28eea9a33c
rewrite to fix english.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
1705
diff
changeset
|
69 drop the database with existing data. |
|
1433
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
70 |
|
8429095241d7
mysql tests will not be run if there is no chance of passing.
Andrey Lebedev <kedder@users.sourceforge.net>
parents:
diff
changeset
|
71 |
|
2067
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
72 Showing MySQL who's boss |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
73 ======================== |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
74 |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
75 If things ever get to the point where that test database is totally hosed, |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
76 just:: |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
77 |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
78 $ su - |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
79 # /etc/init.d/mysql stop |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
80 # rm -rf /var/lib/mysql/rounduptest |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
81 # /etc/init.d/mysql start |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
82 |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
83 and all will be better (note that on some systems, ``mysql`` is spelt |
|
dbb78664e427
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
1913
diff
changeset
|
84 ``mysqld``). |
|
2921
ad4fb8a14a97
more doc updates, not so many TODOs any more
Richard Jones <richard@users.sourceforge.net>
parents:
2860
diff
changeset
|
85 |
