<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >MySQL backend</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PowerDNS manual" HREF="index.html"><LINK REL="UP" TITLE="Backends in detail" HREF="backends-detail.html"><LINK REL="PREVIOUS" TITLE="Backends in detail" HREF="backends-detail.html"><LINK REL="NEXT" TITLE="Random Backend" HREF="randombackend.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PowerDNS manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="backends-detail.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Appendix A. Backends in detail</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="randombackend.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="MYSQLBACKEND" >A.2. MySQL backend</A ></H1 ><P > <DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/warning.gif" HSPACE="5" ALT="Warning"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P > This backend is deprecated! Use the Generic MySQL backend which is better in <B CLASS="COMMAND" >all</B > respects. It does support master/slave operation, this backend does not. See <A HREF="generic-mypgsql-backends.html" >Section A.5</A >. </P ><P > So stop reading here unless you already have a database filled with 'mysql' records. </P ></TD ></TR ></TABLE ></DIV > </P ><P > <DIV CLASS="TABLE" ><A NAME="AEN4603" ></A ><P ><B >Table A-2. MySQL backend capabilities</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><TBODY ><TR ><TD >Native</TD ><TD >Yes</TD ></TR ><TR ><TD >Master</TD ><TD >No</TD ></TR ><TR ><TD >Slave</TD ><TD >No</TD ></TR ><TR ><TD >Superslave</TD ><TD >No</TD ></TR ><TR ><TD >Autoserial</TD ><TD >Yes</TD ></TR ><TR ><TD >Case</TD ><TD >Insensitive</TD ></TR ><TR ><TD >Module name</TD ><TD >mysql</TD ></TR ><TR ><TD >Launch name</TD ><TD >mysql</TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > The MySQL Backend as present in PDNS is fixed - it requires a certain database schema to function. This schema corresponds to this create statement: <PRE CLASS="SCREEN" > CREATE TABLE records ( id int(11) NOT NULL auto_increment, domain_id int(11) NOT NULL, name varchar(255) NOT NULL, type varchar(6) NOT NULL, content varchar(255) NOT NULL, ttl int(11) NOT NULL, prio int(11) default NULL, change_date int(11) default NULL, PRIMARY KEY (id), KEY name_index(name), KEY nametype_index(name,type), KEY domainid_index(domain_id) ); </PRE > Every domain should have a unique domain_id, which should remain identical for all records in a domain. Records with a domain_id that differs from that in the domain SOA record will not appear in a zone transfer. </P ><P > The change_date may optionally be updated to the time_t (the number of seconds since midnight UTC at the start of 1970), and is in that case used to auto calculate the SOA serial number in case that is unspecified. </P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN4634" >A.2.1. Configuration settings</A ></H2 ><P > WARNING! Make sure that you can actually resolve the hostname of your database without accessing the database! It is advised to supply an IP address here to prevent chicken/egg problems! </P ><P > <P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >mysql-dbname</DT ><DD ><P > Database name to connect to </P ></DD ><DT >mysql-host</DT ><DD ><P > Database host to connect to </P ></DD ><DT >mysql-password</DT ><DD ><P > Password to connect with </P ></DD ><DT >mysql-socket</DT ><DD ><P > MySQL socket to use for connecting </P ></DD ><DT >mysql-table</DT ><DD ><P > MySQL table name. Defaults to 'records'. </P ></DD ><DT >mysql-user</DT ><DD ><P > MySQL user to connect as </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN4663" >A.2.2. Notes</A ></H2 ><P > It has been observed that InnoDB tables outperform the default MyISAM tables by a large margin. Furthermore, the default number of backends (3) should be raised to 10 or 15 for busy servers. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="backends-detail.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="randombackend.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Backends in detail</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="backends-detail.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Random Backend</TD ></TR ></TABLE ></DIV ></BODY ></HTML >