]> git.ipfire.org Git - thirdparty/pdns.git/blame - docs/backends/generic-mysql.rst
Fix 7680: gmysql-thread-cleanup option documented incorrectly
[thirdparty/pdns.git] / docs / backends / generic-mysql.rst
CommitLineData
0e2063c3
PL
1Generic MySQL backend
2=====================
3
4* Native: Yes
5* Master: Yes
6* Slave: Yes
7* Superslave: Yes
76e1255a 8* Autoserial: No
0e2063c3
PL
9* Case: All lower
10* DNSSEC: Yes (set ``gmysql-dnssec``)
11* Disabled data: Yes
12* Comments: Yes
13* Module name: gmysql
14* Launch name: ``gmysql``
15
16.. warning::
17 If using MySQL with 'slave' support enabled in PowerDNS you
18 **must** run MySQL with a table engine that supports transactions. In
19 practice, great results are achieved with the 'InnoDB' tables. PowerDNS
20 will silently function with non-transaction aware MySQLs but at one
21 point this is going to harm your database, for example when an incoming
22 zone transfer fails.
23
24The default schema is included at the bottom of this page.
25:ref:`migration-zone2sql` with the ``--gmysql`` flag also
26assumes this layout is in place. For full migration notes, please see
27:doc:`../migration`. This schema contains all elements needed
28for master, slave and superslave operation.
29
30When using the InnoDB storage engine, we suggest adding foreign key
31contraints to the tables in order to automate deletion of records, key
32material, and other information upon deletion of a domain from the
33domains table. The following SQL does the job:
34
35.. literalinclude:: ../../modules/gmysqlbackend/enable-foreign-keys.mysql.sql
36
37Using MySQL replication
38-----------------------
39
40To support ``NATIVE`` domains, the ``binlog_format`` for the MySQL
41replication **must** be set to ``MIXED`` or ``ROW`` to prevent
42differences in data between replicated servers. See `"Setting
43The Binary Log
44Format" <http://dev.mysql.com/doc/refman/5.7/en/binary-log-setting.html>`__
45for more information.
46
47Settings
48--------
49
50.. _setting-gmysql-host:
51
52``gmysql-host``
53^^^^^^^^^^^^^^^
54
55Host (ip address) to connect to. Mutually exclusive with :ref:`setting-gmysql-socket`.
56
57.. warning::
58 When specified as a hostname a chicken/egg situation might
59 arise where the database is needed to resolve the IP address of the
60 database. It is best to supply an IP address of the database here.
61
62.. _setting-gmysql-port:
63
64``gmysql-port``
65^^^^^^^^^^^^^^^
66
5878ea8d 67The port to connect to on :ref:`setting-gmysql-host`. Default: 3306.
0e2063c3
PL
68
69.. _setting-gmysql-socket:
70
71``gmysql-socket``
72^^^^^^^^^^^^^^^^^
73
74Connect to the UNIX socket at this path. Mutually exclusive with :ref:`setting-gmysql-host`.
75
76.. _setting-gmysql-dbname:
77
78``gmysql-dbname``
79^^^^^^^^^^^^^^^^^
80
76752d8a 81Name of the database to connect to. Default: "powerdns".
0e2063c3
PL
82
83.. _setting-gmysql-user:
84
85``gmysql-user``
86^^^^^^^^^^^^^^^
87
88User to connect as. Default: "powerdns".
89
90.. _setting-gmysql-group:
91
92``gmysql-group``
93^^^^^^^^^^^^^^^^
94
95Group to connect as. Default: "client".
96
97.. _setting-gmysql-password:
98
99``gmysql-password``
100^^^^^^^^^^^^^^^^^^^
101
102The password to for :ref:`setting-gmysql-user`.
103
104.. _setting-gmysql-dnssec:
105
106``gmysql-dnssec``
107^^^^^^^^^^^^^^^^^
108
5878ea8d 109Enable DNSSEC processing for this backend. Default: no.
0e2063c3
PL
110
111.. _setting-gmysql-innodb-read-committed:
112
113``gmysql-innodb-read-committed``
114^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
5878ea8d 116Use the InnoDB READ-COMMITTED transaction isolation level. Default: yes.
0e2063c3
PL
117
118.. _setting-gmysql-timeout:
119
120``gmysql-timeout``
121^^^^^^^^^^^^^^^^^^
122
123The timeout in seconds for each attempt to read from, or write to the
124server. A value of 0 will disable the timeout. Default: 10
125
a36f89be 126.. _setting-gmysql-thread-cleanup:
863025cc 127
a36f89be 128``gmysql-thread-cleanup``
863025cc 129^^^^^^^^^^^^^^^^^^^^^^^^
68f348bd 130.. versionadded:: 4.1.8
863025cc 131
a36f89be 132Older versions (such as those shipped on RHEL 7) of the MySQL/MariaDB client libraries leak memory unless applications explicitly report the end of each thread to the library. Enabling ``gmysql-thread-cleanup`` tells PowerDNS to call ``mysql_thread_end()`` whenever a thread ends.
863025cc
PD
133
134Only enable this if you are certain you need to. For more discussion, see https://github.com/PowerDNS/pdns/issues/6231.
135
0e2063c3
PL
136Default Schema
137--------------
138
64c6a9a7
PD
139This is the 4.2 schema. Please find `the 4.1 schema on GitHub <https://github.com/PowerDNS/pdns/blob/rel/auth-4.1.x/modules/gmysqlbackend/schema.mysql.sql>`_.
140
0e2063c3 141.. literalinclude:: ../../modules/gmysqlbackend/schema.mysql.sql