201 lines
10 KiB
HTML
201 lines
10 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
|
<title>MySQLTuner-perl by major</title>
|
|
|
|
<link rel="stylesheet" href="stylesheets/styles.css">
|
|
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
<body>
|
|
<div class="wrapper">
|
|
<header>
|
|
<h1>MySQLTuner-perl</h1>
|
|
<p>MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.</p>
|
|
|
|
<p class="view"><a href="https://github.com/major/MySQLTuner-perl">View the Project on GitHub <small>major/MySQLTuner-perl</small></a></p>
|
|
|
|
|
|
|
|
<ul>
|
|
<li><a href="https://github.com/major/MySQLTuner-perl/zipball/master">Download <strong>ZIP File</strong></a></li>
|
|
<li><a href="https://github.com/major/MySQLTuner-perl/tarball/master">Download <strong>TAR Ball</strong></a></li>
|
|
<li><a href="https://github.com/major/MySQLTuner-perl">View On <strong>GitHub</strong></a></li>
|
|
</ul>
|
|
</header>
|
|
<section>
|
|
<h1>
|
|
<a name="mysqltuner-perl" class="anchor" href="#mysqltuner-perl"><span class="octicon octicon-link"></span></a>MySQLTuner-perl</h1>
|
|
|
|
<p><b>MySQLTuner</b> is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.</p>
|
|
|
|
<p><b>MySQLTuner</b> supports in this last version ~250 indicators for MySQL/MariaDB/Percona Server. <p>
|
|
|
|
<p><b>MySQLTuner</b> is maintained and indicator collect is increasing week after week supporting a lot of configurtion sush as:</p>
|
|
<ul>
|
|
<li><a href="http://galeracluster.com">Galera Cluster</a></li>
|
|
<li><a href="">TokuDB](https://www.percona.com/software/mysql-database/percona-tokudb)</a></li>
|
|
<li><a href="">Performance schema](https://github.com/mysql/mysql-sys)</a> </li>
|
|
<li><a href="">Linux OS metrics,</a>
|
|
<li><a href="http://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html">InnoDB</a> </li>
|
|
<li><a href="http://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html">MyISAM</a> </li>
|
|
<li><a href="https://mariadb.com/kb/en/mariadb/aria">Aria, </a>
|
|
<li>...</li>
|
|
</ul>
|
|
|
|
<p>You can found more details on this indicators at <a href="https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md">Indicators description]</a>.</p>
|
|
|
|
<img src="https://github.com/major/MySQLTuner-perl/raw/master/mysqltuner.png" alt='mysqltuner' />
|
|
<h1>Compatibility:</h1>
|
|
|
|
<ul>
|
|
|
|
<li>MySQL 3.23, 4.0, 4.1, 5.0, 5.1, 5.5, 5.6, 5.7 (full support)</li>
|
|
<li>MariaDB 5.5, 10.0, 10.1 (full support)</li>
|
|
<li>MariaDB 10.2 and MySQL 8.0 (partial support)</li>
|
|
<li>MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (deprecated editor support)</li>
|
|
<li>Perl 5.6 or later (with <a href="http://search.cpan.org/%7Edapm/perl-5.14.4/pod/perldoc.pod">perl-doc</a> package)</li>
|
|
<li>Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants)</li>
|
|
<li>Windows is not supported at this time</li>
|
|
<li>Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.0)</li>
|
|
</ul><h2>
|
|
<a name="warning" class="anchor" href="#warning"><span class="octicon octicon-link"></span></a><strong><em>WARNING</em></strong>
|
|
</h2>
|
|
|
|
<p>It is <strong>extremely important</strong> for you to fully understand each change
|
|
you make to a MySQL database server. If you don't understand portions
|
|
of the script's output, or if you don't understand the recommendations,
|
|
<strong>you should consult</strong> a knowledgeable DBA or system administrator
|
|
that you trust. <strong>Always</strong> test your changes on staging environments, and
|
|
always keep in mind that improvements in one area can <strong>negatively affect</strong>
|
|
MySQL in other areas.</p>
|
|
|
|
<p><strong>Seriously - please review the FAQ section below.</strong></p>
|
|
|
|
<h2>Checks performed by MySQLTuner</h2>
|
|
<p>
|
|
All checks done by <b>MySQLTuner</b> are documented in <a href="https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md">MySQLTuner Internals</a> documentation.
|
|
</p>
|
|
|
|
<h2>
|
|
<a name="downloadinstallation" class="anchor" href="#downloadinstallation"><span class="octicon octicon-link"></span></a>Download/Installation</h2>
|
|
|
|
<p>You can download the entire repository by using 'git clone' followed by the cloning URL above. The simplest and shortest method is:</p>
|
|
|
|
<pre><code>
|
|
wget http://mysqltuner.pl/ -O mysqltuner.pl
|
|
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
|
|
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
|
|
perl mysqltuner.pl
|
|
</code></pre>
|
|
|
|
<p>Of course, you can add the execute bit (<code>chmod +x mysqltuner.pl</code>) so you can execute it without calling perl directly.</p>
|
|
|
|
|
|
<h2><a id="user-content-specific-usage" class="anchor" href="#specific-usage" aria-hidden="true"><span class="octicon octicon-link"></span></a>Specific usage</h2>
|
|
|
|
<p><strong>Usage:</strong> Minimal usage locally</p>
|
|
|
|
<pre><code>perl mysqltuner.pl
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Minimal usage remotely</p>
|
|
|
|
<pre><code>perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Enable maximum output information around MySQL/MariaDb without debugging </p>
|
|
|
|
<pre><code>perl mysqltuner.pl --buffers --dbstat --idxstat
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Write your result in a file with information displayed </p>
|
|
|
|
<pre><code>perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Write your result in a file <strong>without outputting information</strong> </p>
|
|
|
|
<pre><code>perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Using template model to customize your reporting file based on <a href="https://metacpan.org/pod/Text::Template">Text::Template</a> syntax.</p>
|
|
|
|
<pre><code>perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl
|
|
</code></pre>
|
|
|
|
<p><strong>Usage:</strong> Enable debugging information </p>
|
|
|
|
<pre><code>perl mysqltuner.pl --debug
|
|
</code></pre>
|
|
|
|
<h2>
|
|
<a name="faq" class="anchor" href="#faq"><span class="octicon octicon-link"></span></a>FAQ</h2>
|
|
|
|
<p>Question: Will MySQLTuner fix my slow MySQL server?</p>
|
|
|
|
<p><strong>No.</strong> MySQLTuner is a read only script. It won't write to any configuration files, change the status of any daemons, or call your mother to wish her a happy birthday. It will give you an overview of your server's performance and make some basic recommendations about improvements that you can make after it completes. <em>Make sure you read the warning above prior to following any recommendations.</em></p>
|
|
|
|
<p>Question: Can I fire my DBA now?</p>
|
|
|
|
<p><strong>MySQLTuner will not replace your DBA in any form or fashion.</strong> If your DBA constantly takes your parking spot and steals your lunch from the fridge, then you may want to consider it - but that's your call.</p>
|
|
|
|
<p>Question: Why does MySQLTuner keep asking me the login credentials for MySQL over and over?</p>
|
|
|
|
<p>The script will try its best to log in via any means possible. It will check for ~/.my.cnf files, Plesk password files, and empty password root logins. If none of those are available, then you'll be prompted for a password. If you'd like the script to run in an automated fashion without user intervention, then create a .my.cnf file in your home directory which contains:</p>
|
|
|
|
<pre><code>[client]
|
|
user=someusername
|
|
pass=thatuserspassword
|
|
</code></pre>
|
|
|
|
<p>Once you create it, make sure it's owned by your user and the mode on the file is 0600. This should prevent the prying eyes from getting your database login credentials under normal conditions. If a <a href="https://en.wikipedia.org/wiki/T-1000">T-1000 shows up in a LAPD uniform</a> and demands your database credentials, you won't have much of an option.</p>
|
|
|
|
<p>Question: It's not working on my OS! What gives?!</p>
|
|
|
|
<p>These kinds of things are bound to happen. Here are the details I need from you in order to research the problem thoroughly:</p>
|
|
|
|
<pre><code>* OS and OS version
|
|
* Architecture (x86, x86_64, IA64, Commodore 64)
|
|
* Exact MySQL version
|
|
* Where you obtained your MySQL version (OS package, source, etc)
|
|
* The full text of the error
|
|
* A copy of SHOW VARIABLES and SHOW GLOBAL STATUS output (if possible)
|
|
</code></pre>
|
|
|
|
<h2>MySQLTuner-perl needs you</h2>
|
|
<p><b>MySQLTuner</b> needs contributors for documentation, code and feedbacks..</p>
|
|
<ul>
|
|
<li>Please join us on issue track at <a href="https://github.com/major/MySQLTuner-perl/issues">GitHub tracker</a>.</li>
|
|
<li>Contribution guide is avalaible following <a href="https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md">CONTRIBUTING</a> to MySQLTuner.</li>
|
|
<li>Star <b>MySQLTuner</b> project at <a href="https://github.com/major/MySQLTuner-perl"><strong>MySQLTuner GitHub</strong></a>.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</section>
|
|
<footer>
|
|
<p>This project is maintained by <a href="https://github.com/major">major</a></p>
|
|
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
|
|
</footer>
|
|
</div>
|
|
<script src="javascripts/scale.fix.js"></script>
|
|
<script type="text/javascript">
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
</script>
|
|
<script type="text/javascript">
|
|
try {
|
|
var pageTracker = _gat._getTracker("UA-1115744-17");
|
|
pageTracker._trackPageview();
|
|
} catch(err) {}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|