<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>3.6.1. MySQL — Bugzilla 5.0.4 documentation</title> <link rel="stylesheet" href="../_static/bugzilla.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '5.0.4', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="3.6.2. PostgreSQL" href="postgresql.html" /> <link rel="prev" title="3.6. Database Server" href="db_server.html" /> </head> <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="postgresql.html" title="3.6.2. PostgreSQL" accesskey="N">next</a></li> <li class="right" > <a href="db_server.html" title="3.6. Database Server" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Bugzilla 5.0.4 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >3. Installation and Maintenance Guide</a> »</li> <li class="nav-item nav-item-2"><a href="db_server.html" accesskey="U">3.6. Database Server</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="mysql"> <span id="id1"></span><h1>3.6.1. MySQL<a class="headerlink" href="#mysql" title="Permalink to this headline">¶</a></h1> <p>You need MySQL version 5.0.15 or higher.</p> <p>It's possible to test which version of MySQL you have installed with:</p> <p><strong class="command">mysql -V</strong></p> <div class="section" id="installing"> <h2>3.6.1.1. Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h2> <div class="section" id="windows"> <h3>Windows<a class="headerlink" href="#windows" title="Permalink to this headline">¶</a></h3> <p>Download the MySQL 32-bit or 64-bit MSI installer from the <a class="reference external" href="http://www.mysql.com/downloads/mysql/">MySQL website</a> (~28 MB).</p> <p>MySQL has a standard Windows installer. It's ok to select a Typical MySQL install (the default). The rest of this documentation assumes assume you have installed MySQL into <code class="file docutils literal"><span class="pre">C:\mysql</span></code>. Adjust paths appropriately if not.</p> </div> <div class="section" id="linux-mac-os-x"> <h3>Linux/Mac OS X<a class="headerlink" href="#linux-mac-os-x" title="Permalink to this headline">¶</a></h3> <p>The package install instructions given previously should have installed MySQL on your machine, if it didn't come with it already. Run:</p> <p><strong class="command">mysql_secure_installation</strong></p> <p>and follow its advice.</p> <p>If you did install MySQL manually rather than from a package, make sure the server is started when the machine boots.</p> </div> </div> <div class="section" id="add-a-user"> <span id="mysql-add-user"></span><h2>3.6.1.2. Add a User<a class="headerlink" href="#add-a-user" title="Permalink to this headline">¶</a></h2> <p>You need to add a new MySQL user for Bugzilla to use. Run the <code class="file docutils literal"><span class="pre">mysql</span></code> command-line client and enter:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">GRANT</span> <span class="n">SELECT</span><span class="p">,</span> <span class="n">INSERT</span><span class="p">,</span> <span class="n">UPDATE</span><span class="p">,</span> <span class="n">DELETE</span><span class="p">,</span> <span class="n">INDEX</span><span class="p">,</span> <span class="n">ALTER</span><span class="p">,</span> <span class="n">CREATE</span><span class="p">,</span> <span class="n">LOCK</span> <span class="n">TABLES</span><span class="p">,</span> <span class="n">CREATE</span> <span class="n">TEMPORARY</span> <span class="n">TABLES</span><span class="p">,</span> <span class="n">DROP</span><span class="p">,</span> <span class="n">REFERENCES</span> <span class="n">ON</span> <span class="n">bugs</span><span class="o">.*</span> <span class="n">TO</span> <span class="n">bugs</span><span class="nd">@localhost</span> <span class="n">IDENTIFIED</span> <span class="n">BY</span> <span class="s1">'$DB_PASS'</span><span class="p">;</span> <span class="n">FLUSH</span> <span class="n">PRIVILEGES</span><span class="p">;</span> </pre></div> </div> <p>You need to replace <code class="docutils literal"><span class="pre">$DB_PASS</span></code> with a strong password you have chosen. Write that password down somewhere.</p> <p>The above command permits an account called <code class="docutils literal"><span class="pre">bugs</span></code> to connect from the local machine, <code class="docutils literal"><span class="pre">localhost</span></code>. Modify the command to reflect your setup if you will be connecting from another machine or as a different user.</p> </div> <div class="section" id="change-configuration"> <h2>3.6.1.3. Change Configuration<a class="headerlink" href="#change-configuration" title="Permalink to this headline">¶</a></h2> <p>To change MySQL's configuration, you need to edit your MySQL configuration file, which is:</p> <ul class="simple"> <li>Red Hat/Fedora: <code class="file docutils literal"><span class="pre">/etc/my.cnf</span></code></li> <li>Debian/Ubuntu: <code class="file docutils literal"><span class="pre">/etc/mysql/my.cnf</span></code></li> <li>Windows: <code class="file docutils literal"><span class="pre">C:\mysql\bin\my.ini</span></code></li> <li>Mac OS X: <code class="file docutils literal"><span class="pre">/etc/my/cnf</span></code></li> </ul> <div class="section" id="allow-large-attachments-and-many-comments"> <span id="mysql-max-allowed-packet"></span><h3>Allow Large Attachments and Many Comments<a class="headerlink" href="#allow-large-attachments-and-many-comments" title="Permalink to this headline">¶</a></h3> <p>By default on some systems, MySQL will only allow you to insert things into the database that are smaller than 1MB.</p> <p>Bugzilla attachments may be larger than this. Also, Bugzilla combines all comments on a single bug into one field for full-text searching, and the combination of all comments on a single bug could in some cases be larger than 1MB.</p> <p>We recommend that you allow at least 16MB packets by adding or altering the <code class="docutils literal"><span class="pre">max_allowed_packet</span></code> parameter in your MySQL configuration in the <code class="docutils literal"><span class="pre">[mysqld]</span></code> section, so that the number is at least 16M, like this (note that it's <code class="docutils literal"><span class="pre">M</span></code>, not <code class="docutils literal"><span class="pre">MB</span></code>):</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">mysqld</span><span class="p">]</span> <span class="c1"># Allow packets up to 16M</span> <span class="n">max_allowed_packet</span><span class="o">=</span><span class="mi">16</span><span class="n">M</span> </pre></div> </div> </div> <div class="section" id="allow-small-words-in-full-text-indexes"> <span id="mysql-small-words"></span><h3>Allow Small Words in Full-Text Indexes<a class="headerlink" href="#allow-small-words-in-full-text-indexes" title="Permalink to this headline">¶</a></h3> <p>By default, words must be at least four characters in length in order to be indexed by MySQL's full-text indexes. This causes a lot of Bugzilla-specific words to be missed, including "cc", "ftp" and "uri".</p> <p>MySQL can be configured to index those words by setting the <code class="docutils literal"><span class="pre">ft_min_word_len</span></code> param to the minimum size of the words to index.</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">mysqld</span><span class="p">]</span> <span class="c1"># Allow small words in full-text indexes</span> <span class="n">ft_min_word_len</span><span class="o">=</span><span class="mi">2</span> </pre></div> </div> </div> </div> <div class="section" id="permit-attachments-table-to-grow-beyond-4gb"> <span id="mysql-attach-table-size"></span><h2>3.6.1.4. Permit Attachments Table to Grow Beyond 4GB<a class="headerlink" href="#permit-attachments-table-to-grow-beyond-4gb" title="Permalink to this headline">¶</a></h2> <p>This is optional configuration for Bugzillas which are expected to become very large, and needs to be done after Bugzilla is fully installed.</p> <p>By default, MySQL will limit the size of a table to 4GB. This limit is present even if the underlying filesystem has no such limit. To set a higher limit, run the <code class="file docutils literal"><span class="pre">mysql</span></code> command-line client and enter the following, replacing <code class="docutils literal"><span class="pre">$bugs_db</span></code> with your Bugzilla database name (which is <code class="docutils literal"><span class="pre">bugs</span></code> by default):</p> <div class="highlight-sql"><div class="highlight"><pre><span></span>USE $bugs_db; ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000; </pre></div> </div> <p>The above command will change the limit to 20GB. MySQL will have to make a temporary copy of your entire table to do this, so ideally you should do this when your attachments table is still small.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">If you have set the setting in Bugzilla which allows large attachments to be stored on disk, the above change does not affect that.</p> </div> <hr class="docutils" /> <p>This documentation undoubtedly has bugs; if you find some, please file them <a class="reference external" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=Documentation">here</a>.</p> </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/bugzilla.png" alt="Logo"/> </a></p> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">3.6.1. MySQL</a><ul> <li><a class="reference internal" href="#installing">3.6.1.1. Installing</a><ul> <li><a class="reference internal" href="#windows">Windows</a></li> <li><a class="reference internal" href="#linux-mac-os-x">Linux/Mac OS X</a></li> </ul> </li> <li><a class="reference internal" href="#add-a-user">3.6.1.2. Add a User</a></li> <li><a class="reference internal" href="#change-configuration">3.6.1.3. Change Configuration</a><ul> <li><a class="reference internal" href="#allow-large-attachments-and-many-comments">Allow Large Attachments and Many Comments</a></li> <li><a class="reference internal" href="#allow-small-words-in-full-text-indexes">Allow Small Words in Full-Text Indexes</a></li> </ul> </li> <li><a class="reference internal" href="#permit-attachments-table-to-grow-beyond-4gb">3.6.1.4. Permit Attachments Table to Grow Beyond 4GB</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="db_server.html" title="previous chapter">3.6. Database Server</a></p> <h4>Next topic</h4> <p class="topless"><a href="postgresql.html" title="next chapter">3.6.2. PostgreSQL</a></p> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="postgresql.html" title="3.6.2. PostgreSQL" >next</a></li> <li class="right" > <a href="db_server.html" title="3.6. Database Server" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Bugzilla 5.0.4 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >3. Installation and Maintenance Guide</a> »</li> <li class="nav-item nav-item-2"><a href="db_server.html" >3.6. Database Server</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.6. </div> </body> </html>