view doc/mysql.txt @ 6163:c2fd254c9257

Doc updates/indexing. doc/admin_guide.txt, doc/customizing.txt, doc/features.txt, doc/installation.txt, doc/mysql.txt, doc/postgresql.txt: adding index entries doc/customizing.txt: reference schema changes later in document in addition to wiki. website/www/contents.txt: make wiki url https:.... Remove indices/tables as they don't show up in web interface. Put docs/announcement.txt into hidden toctree to silence warning from sphinx. Announcement.txt is referenced from index.txt so can't silence by adding to conf.py exclude_patern. website/www/index.txt: mention security and other improvements in jinja2 templates. website/www/conf.py: get rid of all warning by using exclude_patterns to ignore docs that aren't included. Remove exclude_trees using exclude_pattern instead. Make html_add_permalinks value acceptable so no warning reported. website/www/_static/style.css, website/www/_templtes/layout.html: add prev/next/index links for all doc pages.
author John Rouillard <rouilj@ieee.org>
date Wed, 13 May 2020 00:40:14 -0400
parents e48b039b0ec0
children 81ae33038ec5
line wrap: on
line source

.. index:: mysql; debugging notes

=============
MySQL Backend
=============

This notes detail the MySQL backend for the Roundup issue tracker.


Prerequisites
=============

To use MySQL as the backend for storing roundup data, you also need 
to install:

1. MySQL RDBMS 4.0.18 or higher - https://www.mysql.com/. Your MySQL
   installation MUST support InnoDB tables (or Berkeley DB (BDB) tables
   if you have no other choice). If you're running < 4.0.18 (but not <4.0)
   then you'll need to use BDB to pass all unit tests. Edit the
   ``roundup/backends/back_mysql.py`` file to enable DBD instead of InnoDB.
2. Python MySQL interface - https://pypi.org/project/mysqlclient/


Other Configuration
===================

If you are indexing large documents (e.g attached file contents)
using MySQL, you may need to increase the max_allowed_packet size.
If you don't you can see the error::

   'MySql Server has gone away (2006)'

To do this edit /etc/my.conf and change::

    [mysqld]
    max_allowed_packet = 1M

the 'max_allowed_packet' value from '1M' to '64M' or
larger.

Alternatively you can install an alternate indexer (whoosh, xapian
etc.) and force the tracker to use it by setting the ``indexer``
setting in the tracker's ``config.ini``.

This fix was supplied by telsch. See issue
https://issues.roundup-tracker.org/issue2550743 for further info or if
you are interested in developing a patch to roundup to help work
around this issue.

Running the MySQL tests
=======================

Roundup tests expect an empty MySQL database. Two alternate ways to provide 
this:

1. If you have root permissions on the MySQL server, you can create 
   the necessary database entries using the follwing SQL sequence. Use
   ``mysql`` on the command line to enter::

       CREATE DATABASE rounduptest;
       USE rounduptest;
       GRANT ALL PRIVILEGES ON rounduptest.* TO rounduptest@localhost
            IDENTIFIED BY 'rounduptest';
       FLUSH PRIVILEGES;

2. If your administrator has provided you with database connection info, 
   see the config values in 'test/db_test_base.py' 
   about which database connection, name and user will be used.

The MySQL database should not contain any tables. Tests will not 
drop the database with existing data.


Showing MySQL who's boss
========================

If things ever get to the point where that test database is totally hosed,
just::

  $ su -
  # /etc/init.d/mysql stop
  # rm -rf /var/lib/mysql/rounduptest
  # /etc/init.d/mysql start

and all will be better (note that on some systems, ``mysql`` is spelt
``mysqld``).


Roundup Issue Tracker: http://roundup-tracker.org/