GithubHelp home page GithubHelp logo

major / mysqltuner-perl Goto Github PK

View Code? Open in Web Editor NEW
8.8K 8.8K 1.3K 33.31 MB

MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.

License: GNU General Public License v3.0

Perl 88.48% Shell 4.92% Smarty 0.54% HTML 1.38% Jinja 3.28% Makefile 1.07% Dockerfile 0.32%

mysqltuner-perl's Introduction

MySQLTuner-perl

"Buy Us A Coffee"

Project Status Test Status Average time to resolve an issue Percentage of open issues GPL License

MySQLTuner 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.

MySQLTuner supports ~300 indicators for MySQL/MariaDB/Percona Server in this latest version.

MySQLTuner is actively maintained supporting many configurations such as Galera Cluster, TokuDB, Performance schema, Linux OS metrics, InnoDB, MyISAM, Aria, ...

You can find more details on these indicators here: Indicators description.

MysqlTuner

MySQLTuner needs you

MySQLTuner needs contributors for documentation, code and feedback:

Anurag's GitHub stats

Stargazers over time

Stargazers over time

Compatibility

Test result are available here:

  • MySQL 8.0, 8.2, 8.3 (full support)

  • Percona Server 8.0, 8.2, 8.3 (full support)

  • MariaDB 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2 (full support)

  • Galera replication (full support)

  • Percona XtraDB cluster (full support)

  • Mysql Replications (partial support, no test environment)

  • MySQL 8.1 (not supported, deprecated version)

  • Percona Server 5.7 (not supported, deprecated version)

  • MySQL 5.7 (not supported, deprecated version)

  • MySQL 5.6 and earlier (not supported, deprecated version)

  • Percona Server 5.6 (not supported, deprecated version)

  • MariaDB 10.7, 10.8, 10.9, 10.10 (not supported, deprecated version)

  • MariaDB 10.3 and earlier (not supported, deprecated version)

  • MariaDB 5.5 (not supported, deprecated version)

Windows Support is partial

UNSUPPORTED ENVIRONMENTS - NEED HELP WITH THAT

  • Cloud based is not supported at this time (Help wanted! GCP, AWS, Azure support requested)

Unsupported storage engines: PRs welcome

  • NDB is not supported feel free to create a Pull Request
  • Archive
  • Spider
  • ColummStore
  • Connect

Unmaintenained staff from MySQL or MariaDB:

  • MyISAM is too old and no longer active

  • RockDB is not maintained anymore

  • TokuDB is not maintained anymore

  • XtraDB is not maintained anymore

  • CVE vulnerabilities detection support from https://cve.mitre.org

MINIMAL REQUIREMENTS

  • Perl 5.6 or later (with perl-doc package)
  • Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants)
  • Unrestricted read access to the MySQL server OS root access recommended for MySQL < 5.1

WARNING

It is important 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, you should consult a knowledgeable DBA or system administrator that you trust. Always test your changes on staging environments, and always keep in mind that improvements in one area can adversely affect MySQL in other areas.

It's also important to wait at least 24 hours of uptime to get accurate results. In fact, running mysqltuner on a fresh restarted server is completely useless.

Also review the FAQ section below.

Security recommendations

Hi directadmin user! We detected that you run mysqltuner with da_admin's credentials taken from /usr/local/directadmin/conf/my.cnf, which might bring to a password discovery! Read link for more details Issue #289.

What is MySQLTuner checking exactly ?

All checks done by MySQLTuner are documented in MySQLTuner Internals documentation.

Download/Installation

Choose one of these methods:

  1. Script direct download (the simplest and shortest method):
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
  1. You can download the entire repository by using git clone or git clone --depth 1 -b master followed by the cloning URL above.

Optional Sysschema installation for MySQL 5.6

Sysschema is installed by default under MySQL 5.7 and MySQL 8 from Oracle. By default, on MySQL 5.6/5.7/8, performance schema is enabled by default. For previous MySQL 5.6 version, you can follow this command to create a new database sys containing very useful view on Performance schema:

Sysschema for MySQL old version

curl "https://codeload.github.com/mysql/mysql-sys/zip/master" > sysschema.zip
# check zip file
unzip -l sysschema.zip
unzip sysschema.zip
cd mysql-sys-master
mysql -uroot -p < sys_56.sql

Sysschema for MariaDB old version

curl "https://github.com/FromDual/mariadb-sys/archive/refs/heads/master.zip" > sysschema.zip
# check zip file
unzip -l sysschema.zip
unzip sysschema.zip
cd mariadb-sys-master
mysql -u root -p < ./sys_10.sql

Performance schema setup

By default, performance_schema is enabled and sysschema is installed on latest version.

By default, on MariaDB, performance schema is disabled by default (MariaDB<10.6).

Consider activating performance schema across your my.cnf configuration file:

[mysqld]
performance_schema = on
performance-schema-consumer-events-statements-history-long = ON
performance-schema-consumer-events-statements-history = ON
performance-schema-consumer-events-statements-current = ON
performance-schema-consumer-events-stages-current=ON
performance-schema-consumer-events-stages-history=ON
performance-schema-consumer-events-stages-history-long=ON
performance-schema-consumer-events-transactions-current=ON
performance-schema-consumer-events-transactions-history=ON
performance-schema-consumer-events-transactions-history-long=ON
performance-schema-consumer-events-waits-current=ON
performance-schema-consumer-events-waits-history=ON
performance-schema-consumer-events-waits-history-long=ON
performance-schema-instrument='%=ON'
max-digest-length=2048
performance-schema-max-digest-length=2018

Sysschema installation for MariaDB < 10.6

Sysschema is not installed by default under MariaDB prior to 10.6 MariaDB sys

You can follow this command to create a new database sys containing a useful view on Performance schema:

curl "https://codeload.github.com/FromDual/mariadb-sys/zip/master" > mariadb-sys.zip
# check zip file
unzip -l mariadb-sys.zip
unzip mariadb-sys.zip
cd mariadb-sys-master/
mysql -u root -p < ./sys_10.sql

Errors & solutions for performance schema installation

ERROR 1054 (42S22) at line 78 in file: './views/p_s/metrics_56.sql': Unknown column 'STATUS' in 'field list'

This error can be safely ignored Consider using a recent MySQL/MariaDB version to avoid this kind of issue during sysschema installation

In recent versions, sysschema is installed and integrated by default as sys schema (SHOW DATABASES)

ERROR at line 21: Failed to open file './tables/sys_config_data_10.sql -- ported', error: 2 Have a look at #452 solution given by @ericx

Fixing sysctl configuration (/etc/sysctl.conf)

-- It is a system wide setting and not a database setting: Linux FS Kernel settings

You can check its values via:

$ cat /proc/sys/fs/aio-*
65536
2305

For example, to set the aio-max-nr value, add the following line to the /etc/sysctl.conf file:

fs.aio-max-nr = 1048576

To activate the new setting:

$ sysctl -p /etc/sysctl.conf

Specific usage

Usage: Minimal usage locally

perl mysqltuner.pl --host 127.0.0.1

Of course, you can add the execute bit (chmod +x mysqltuner.pl) so you can execute it without calling Perl directly.

Usage: Minimal usage remotely

In previous version, --forcemem shoud be set manually, in order to be able to run an MySQLTuner analysis

Since 2.1.10, memory and swap are defined to 1Gb by default.

If you want a more accurate value according to your remote server, feel free to setup --forcemem and --forceswap to real RAM value

perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password

Usage: Enable maximum output information around MySQL/MariaDb without debugging

perl mysqltuner.pl --verbose
perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat --tbstat

Usage: Enable CVE vulnerabilities check for your MariaDB or MySQL version

perl mysqltuner.pl --cvefile=vulnerabilities.csv

Usage: Write your result in a file with information displayed

perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt

Usage: Write your result in a file without outputting information

perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt

Usage: Using template model to customize your reporting file based on Text::Template syntax.

perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl

Important: Text::Template module is mandatory for --reportfile and/or --template options, because this module is needed to generate appropriate output based on a text template.

Usage: Dumping all information_schema and sysschema views as csv file into results subdirectory

perl mysqltuner.pl --verbose --dumpdir=./result

Usage: Enable debugging information

perl mysqltuner.pl --debug

Usage: Update MySQLTuner and data files (password and cve) if needed

perl mysqltuner.pl --checkversion --updateversion

HTML reports based on Python Jinja2

HTML generation is based on Python/Jinja2

HTML generation Procedure

  • Generate mysqltuner.pl report using JSON format (--json)
  • Generate HTML report using j2 python tools

Jinja2 Templates are located under templates sub directory

A basic example is called basic.html.j2

Installation Python j2

python -mvenv j2
source ./j2/bin/activate
(j2) pip install j2

Using Html report generation

perl mysqltuner.pl --verbose --json > reports.json
cat reports.json  j2 -f json MySQLTuner-perl/templates/basic.html.j2 > variables.html

or

perl mysqltuner.pl --verbose --json | j2 -f json MySQLTuner-perl/templates/basic.html.j2 > variables.html

HTML reports based on AHA

HTML generation is based on AHA

HTML generation Procedure

  • Generate mysqltuner.pl report using standard text reports
  • Generate HTML report using aha

Installation Aha

Follow instructions from Github repo

GitHub AHA main repository

Using AHA Html report generation

perl mysqltuner.pl --verbose --color > reports.txt
aha --black --title "MySQLTuner" -f "reports.txt" > "reports.html"

or

perl mysqltuner.pl --verbose --color | aha --black --title "MySQLTuner" > reports.html

FAQ

Question: What are the prerequisites for running MySQL tuner ?

Before running MySQL tuner, you should have the following:

  • A MySQL server installation
  • Perl installed on your system
  • Administrative access to your MySQL server

Question: Can MySQL tuner make changes to my configuration automatically ?

No., MySQL tuner only provides recommendations. It does not make any changes to your configuration files automatically. It is up to the user to review the suggestions and implement them as needed.

Question: How often should I run MySQL tuner ?

It is recommended to run MySQL tuner periodically, especially after significant changes to your MySQL server or its workload.

For optimal results, run the script after your server has been running for at least 24 hours to gather sufficient performance data.

Question: How do I interpret the results from MySQL tuner ?

MySQL tuner provides output in the form of suggestions and warnings.

Review each recommendation and consider implementing the changes in your MySQL configuration file (usually 'my.cnf' or 'my.ini').

Be cautious when making changes and always backup your configuration file before making any modifications.

Question: Can MySQL tuner cause harm to my database or server ?

While MySQL tuner itself will not make any changes to your server, blindly implementing its recommendations without understanding the impact can cause issues.

Always ensure you understand the implications of each suggestion before applying it to your server.

Question: Can I use MySQL tuner for optimizing other database systems like PostgreSQL or SQL Server ?

MySQL tuner is specifically designed for MySQL servers. To optimize other database systems, you would need to use tools designed for those systems, such as pgTune for PostgreSQL or SQL Server's built-in performance tools.

Question: Does MySQL tuner support MariaDB and Percona Server ?

Yes, MySQL tuner supports MariaDB and Percona Server since they are derivatives of MySQL and share a similar architecture. The script can analyze and provide recommendations for these systems as well.

Question: What should I do if I need help with MySQL tuner or have questions about the recommendations ?

If you need help with MySQL tuner or have questions about the recommendations provided by the script, you can consult the MySQL tuner documentation, seek advice from online forums, or consult a MySQL expert.

Be cautious when implementing changes to ensure the stability and performance of your server.

Question: Will MySQLTuner fix my slow MySQL server ?

No. MySQLTuner is a read only script. It won't write to any configuration files, change the status of any daemons. It will give you an overview of your server's performance and make some basic recommendations for improvements that you can make after it completes.

Question: Can I fire my DBA now?

MySQLTuner will not replace your DBA in any form or fashion.

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.

Question: Why does MySQLTuner keep asking me the login credentials for MySQL over and over?

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:

[client]
user=someusername
password=thatuserspassword

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.

Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?

You could use mysql_config_editor utilities.

	$ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost
	Enter password: ********

After which, ~/.mylogin.cnf will be created with the appropriate access.

To get information about stored credentials, use the following command:

$mysql_config_editor print
[client]
user = someusername
password = *****
host = localhost

Question: What's minimum privileges needed by a specific mysqltuner user in database ?

 mysql>GRANT SELECT, PROCESS,EXECUTE, REPLICATION CLIENT,
 SHOW DATABASES,SHOW VIEW
 ON *.*
 TO 'mysqltuner'@'localhost' identified by pwd1234;

Question: It's not working on my OS! What gives?!

These kinds of things are bound to happen. Here are the details I need from you to investigate the issue:

  • 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)

Question: How to perform CVE vulnerability checks?

  • Download vulnerabilities.csv from this repository.
  • use option --cvefile to perform CVE checks

Question: How to use mysqltuner from a remote host? Thanks to @rolandomysqldba

  • You will still have to connect like a mysql client:

Connection and Authentication

--host <hostname> Connect to a remote host to perform tests (default: localhost)
--socket <socket> Use a different socket for a local connection
--port <port>     Port to use for connection (default: 3306)
--user <username> Username to use for authentication
--pass <password> Password to use for authentication
--defaults-file <path> defaults file for credentials

Since you are using a remote host, use parameters to supply values from the OS

--forcemem <size>  Amount of RAM installed in megabytes
--forceswap <size> Amount of swap memory configured in megabytes
  • You may have to contact your remote SysAdmin to ask how much RAM and swap you have

If the database has too many tables, or very large table, use this:

--skipsize           Don't enumerate tables and their types/sizes (default: on)
                     (Recommended for servers with many tables)

Question: Can I install this project using homebrew on Apple Macintosh?

Yes! brew install mysqltuner can be used to install this application using homebrew on Apple Macintosh.

MySQLTuner and Vagrant

MySQLTuner contains following Vagrant configurations:

  • Fedora Core 30 / Docker

Vagrant File is stored in Vagrant subdirectory.

  • Follow following step after vagrant installation: $ vagrant up

MySQLTuner contains a Vagrant configurations for test purpose and development

setup test environments

$ sh build/createTestEnvs.sh

$ source build/bashrc
$ mysql_percona80 sakila
sakila> ...

$ docker images
mariadb                  10.1                fc612450e1f1        12 days ago         352MB
mariadb                  10.2                027b7c57b8c6        12 days ago         340MB
mariadb                  10.3                47dff68107c4        12 days ago         343MB
mariadb                  10.4                92495405fc36        12 days ago         356MB
mysql                    5.6                 95e0fc47b096        2 weeks ago         257MB
mysql                    5.7                 383867b75fd2        2 weeks ago         373MB
mysql                    8.0                 b8fd9553f1f0        2 weeks ago         445MB
percona/percona-server   5.7                 ddd245ed3496        5 weeks ago         585MB
percona/percona-server   5.6                 ed0a36e0cf1b        6 weeks ago         421MB
percona/percona-server   8.0                 390ae97d57c6        6 weeks ago         697MB
mariadb                  5.5                 c7bf316a4325        4 months ago        352MB
mariadb                  10.0                d1bde56970c6        4 months ago        353MB
mysql                    5.5                 d404d78aa797        4 months ago        205MB

$ docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                               NAMES
da2be9b050c9        mariadb:5.5                  "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5311->3306/tcp              mariadb55
5deca25d5ac8        mariadb:10.0                 "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5310->3306/tcp              mariadb100
73aaeb37e2c2        mariadb:10.1                 "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5309->3306/tcp              mariadb101
72ffa77e01ec        mariadb:10.2                 "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5308->3306/tcp              mariadb102
f5996f2041df        mariadb:10.3                 "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5307->3306/tcp              mariadb103
4890c52372bb        mariadb:10.4                 "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:5306->3306/tcp              mariadb104
6b9dc078e921        percona/percona-server:5.6   "/docker-entrypoint.…"   7 hours ago         Up 7 hours          0.0.0.0:4308->3306/tcp              percona56
3a4c7c826d4c        percona/percona-server:5.7   "/docker-entrypoint.…"   7 hours ago         Up 7 hours          0.0.0.0:4307->3306/tcp              percona57
3dda408c91b0        percona/percona-server:8.0   "/docker-entrypoint.…"   7 hours ago         Up 7 hours          33060/tcp, 0.0.0.0:4306->3306/tcp   percona80
600a4e7e9dcd        mysql:5.5                    "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:3309->3306/tcp              mysql55
4bbe54342e5d        mysql:5.6                    "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:3308->3306/tcp              mysql56
a49783249a11        mysql:5.7                    "docker-entrypoint.s…"   7 hours ago         Up 7 hours          33060/tcp, 0.0.0.0:3307->3306/tcp   mysql57
d985820667c2        mysql:8.0                    "docker-entrypoint.s…"   7 hours ago         Up 7 hours          0.0.0.0:3306->3306/tcp, 33060/tcp   mysql 8    0

Contributions welcome !

How to contribute using Pull Request ? Follow this guide : Pull request creation

Simple steps to create a pull request:

  • Fork this Github project
  • Clone it to your local system
  • Make a new branch
  • Make your changes
  • Push it back to your repo
  • Click the Compare & pull request button
  • Click Create pull request to open a new pull request

mysqltuner-perl's People

Contributors

barbzyhool avatar chenrui333 avatar dralbert avatar dutchprogrammer avatar dvdknaap avatar fabiopedretti avatar gibas avatar grooverdan avatar jmrenouard avatar jsoref avatar kn007 avatar koebi001 avatar longradix avatar major avatar mhasbini avatar michaing avatar mrqwer88 avatar netsandbox avatar pes-soft avatar ravage84 avatar red54 avatar renovate[bot] avatar schatt avatar scop avatar sergey-dryabzhinsky avatar sgrossberndt avatar smutel avatar staubiii avatar unreturned avatar vrkansagara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysqltuner-perl's Issues

Memory Usage

The problem: same values for reached and posible:
[!!] Maximum reached memory usage: 11.3G (116% of installed RAM)
[!!] Maximum possible memory usage: 11.3G (116.58% of installed RAM)

The code:

Global memory

$mycalc{'max_used_memory'} = $mycalc{'server_buffers'} + $mycalc{"max_total_per_thread_buffers"};
$mycalc{'total_possible_used_memory'} = $mycalc{'server_buffers'} + $mycalc{'total_per_thread_buffers'};

It should be I believe just be:

Global memory

    $mycalc{'total_possible_used_memory'} = $mycalc{'server_buffers'} + $mycalc{'max_total_per_thread_buffers'};

The new result:
[OK] Maximum reached memory usage: 2.1G (22% of installed RAM)
[!!] Maximum possible memory usage: 11.3G (116.58% of installed RAM)

ERROR 1267 (HY000) at line 1: Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

The following query at line 497 mysqltuner Version 1.4.3 with Currently running supported MySQL version 5.5.42-cll give error due to COLLATION

SELECT CONCAT(user, '@', host) FROM mysql.user WHERE password = PASSWORD(user) OR password = PASSWORD(UPPER(user)) OR password = PASSWORD(UPPER(LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)));

ERROR 1267 (HY000): Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

I change it for:
SELECT CONCAT(user, '@', host) FROM mysql.user WHERE CAST(password as Binary) = PASSWORD(user) OR CAST(password as Binary) = PASSWORD(UPPER(user)) OR CAST(password as Binary) = PASSWORD(UPPER(LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)));

MariaDB 10.0.x support

mysqltuner does not like MariaDB 10.0.x for some reason. Here is output from it.

MariaDB 10.0.x is essentially MySQL 5.6, so I'd love for support to be added.

I am running Ubuntu 12.04 and MariaDB 10.0.4-MariaDB-1~precise-log.

innodb_buffer_pool_instances wrong error

Hi,

I get

[!!] InnoDB buffer pool <= 1Go and innodb_buffer_pool_instances(=1).

and to adjust

innodb_buffer_pool_instances (=1)

Looking at the source of mysqltuner.pl, the calculation - as well as the documentation from maria or mysql - is:

Buffer Pool Size (in GB) / 1GB = Buffer Pool Instances (instances should be roughly 1GB in size).

My configuration is exactly that:

innodb_buffer_pool_size         = 4G
innodb_buffer_pool_instances    = 4

your code for that is

            and $myvar{'innodb_buffer_pool_instances'} != int($myvar{'innodb_buffer_pool_size'}/(1024*1024*1024))

Perhaps a problem in size conversion or display value? Running is MariaDB 5.5.44, Ubuntu 14.04LTS.

Refactor into Library

Please consider refactoring this script into a perl module, so it can be used within other scripts.

If this request is approved, I'm willing to do this refactoring. I've already did this for an internal project based on an older release of mysqltuner. I'm willing to rebase these changes on to an current release if there is a sufficient chance that this would be accepted.

Global symbol "$table_cache_var" requires explicit package name

Just grabbed a copy of MySQLTuner, and hit the following error when running it;

  • Linux version 2.6.32-36-generic (buildd@allspice) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #79-Ubuntu SMP Tue Nov 8 22:29:53 UTC 2011
  • x86_64
  • MySQL 5.1.73-0ubuntu0.10.04.1
  • Installed MySQL via aptitude
Global symbol "$table_cache_var" requires explicit package name at mysqltuner.pl line 919.
Global symbol "$table_cache_var" requires explicit package name at mysqltuner.pl line 920.
Global symbol "$table_cache_var" requires explicit package name at mysqltuner.pl line 921.
Execution of mysqltuner.pl aborted due to compilation errors (#1)
    (F) You've said "use strict" or "use strict vars", which indicates
    that all variables must either be lexically scoped (using "my" or "state"),
    declared beforehand using "our", or explicitly qualified to say
    which package the global variable is in (using "::").

BEGIN not safe after errors--compilation aborted at /usr/share/perl/5.10/Carp/Heavy.pm line 5.
Compilation failed in require at /usr/share/perl/5.10/Carp.pm line 33.

[!!] InnoDB is enabled but isn't being used

i'm kind of new to this so i apologize before hand encase this is an issue that has been address already.

i just installed MySQLTuner on my server and am trying to understand why i am getting :
[!!] InnoDB is enabled but isn't being used

when to my understanding InnoDB i the default. when i run the query 'SHOW ENGINES;' i get this:

mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

adding params to those already in .my.cnf

Hi,

I have a MySQL instance running on a custom port (3307). I have a ~/.my.cnf file with this

[client]
user=my_username
password=my_password
host=127.0.0.1

I've tried to do these lines, but none work :

  • ./mysqltuner.pl --port 3307
  • ./mysqltuner.pl --port=3307
  • ./mysqltuner.pl --port 3307 --user my_username --pass my_password
  • ./mysqltuner.pl --port=3307 --user=my_username --pass=my_password

I get this error :

[!!] Attempted to use login credentials, but they were invalid

I can't use mysqltuner.pl unless I add the port in my .my.cnf file.

I definitely can add this in the config file, but since I use multiple instances, I like to add the port param in the command line, not in the config.

I guess it would be good to use params found in the file, then override them with command line arguments.

Thanks for mysqltuner.pl, it's a great tool.

Support for newer plesk versions (10.2+)

Apparently starting with 10.2, the pwd in .psa.shadow is crypted; You need to read it via
/usr/local/psa/bin/admin –show-password
instead of
cat /etc/psa/.psa.shadow

While at it: why not change
$mysqllogin = "-u admin -pcat /etc/psa/.psa.shadow";
to
$mysqllogin = "-u admin -p'cat /etc/psa/.psa.shadow'";

are we sure that .psa.shadow alwyas contains quotes by default?

key_buffer_size

Since last update, key_buffer_size recommandations are given twice:

[!!] Key buffer used: 22.2% (1M used / 8M cache)
[!!] Key buffer size / total MyISAM indexes: 8.0M/23.8M
Variables to adjust:
    key_buffer_size (~ 1M)
    key_buffer_size (> 23.8M)

select_one and select_array subroutine generalization for SQL request.

I propose also to generalize usage of 2 subroutines:
select_one and select_array subroutine to perform SQL request.

In the current version, we have :
$dummyselect = $mysqlcmd $mysqllogin -Bse "SELECT VERSION();";
can become:
$dummyselect = select_one "SELECT VERSION();"

And
my @mysqlenginelist = $mysqlcmd $mysqllogin -Bse "SHOW ENGINES;" 2>$devnull;
can become
my @mysqlenginelist =select_array "SHOW ENGINES;";

HTTP Redirect Breaks MySQLTuner Version Check

HTTP requests to mysqltuner.com are being redirected to github. That indirectly breaks the version check functionality in the validate_tuner_version subroutine, which includes this line:

my $url = "http://mysqltuner.com/versioncheck.php?v=$tunerversion";

The calls to wget or curl that follow now return the full text of mysqltuner.pl instead of the output of versioncheck.php, so the value of $update isn't what the code currently expects. This consistently produces an "Unable to check for the latest MySQLTuner version" message.

Wrong calculation of InnoDB Read buffer efficiency

Hi,

you have a bug in the calculation for the "InnoDB Read buffer efficiency"

Output of MySQLTuner:
[!!] InnoDB Read buffer efficiency: 0% (18495 hits/ 1692913280 total)

But the efficiency should be 100% in this case.

To fix it, change line 989 of mysqltuner.pl from

$mycalc{'pct_read_efficiency'}=percentage($mystat{'Innodb_buffer_pool_reads'}/$mystat{'Innodb_buffer_pool_read_requests'}) if defined $mystat{'Innodb_buffer_pool_read_requests'};

to

$mycalc{'pct_read_efficiency'}=100-percentage($mystat{'Innodb_buffer_pool_reads'}/$mystat{'Innodb_buffer_pool_read_requests'}) if defined $mystat{'Innodb_buffer_pool_read_requests'};

Unable to determine total memory/swap;

When i try to use mysqltuner.pl on my Ubuntu 14.04.1 LTS with mysql Ver 14.14 Distrib 5.6.19, for debian-linux-gnu (x86_64) using EditLine wrapper i get the following message.

[!!] Unable to determine total memory/swap; use '--forcemem' and '--forceswap'

Is this a bug or my fault or is the actual mysql version not supported?

Thanks

variable key_buffer_size can be 0

your script crashes at line 609 by division by zero.

# Key buffers
if (mysql_version_ge(4, 1)) {
    $mycalc{'pct_key_buffer_used'} = sprintf("%.1f",(1 - (($mystat{'Key_blocks_unused'} * $myvar{'key_cache_block_size'}) / $myvar{'key_buffer_size'})) * 100);
}

Kind regards,
Klaus

using ~/.mylogin.cnf failed

I'm using
mysql_config_editor set --login-path=client --user=user --password --socket=/tmp/mysql.sock
Using
mysql --login-path=cilent
can access to mysql.
But when i using
perl mysqltuner.pl
it was return
Please enter your MySQL administrative login:

I also using
sh tuning-primer.sh
it can access to mysql.

Centos 6 x64
MySQL 5.6.25

Thank you.

General code organization

Hi,

mysqltuner has a non modular code.

I propose to reorganize code as follow.
this is a simple proposal.

1° Init function (Actually there are well defined)
2° Split main topics in separate calculation subroutines
=> Meta data structure creation subroutines
4° render subroutine(s) allowing us to render result as HTML, CSV, TXT, ... format as soon as render subroutine will be added.

Best regards,

Support for Directadmin

For DirectAdmin you can use the following (on existance of this file: /usr/local/directadmin/conf/mysql.conf):

MYSQLUSER="`. /usr/local/directadmin/conf/mysql.conf; echo $user;`"
MYSQLPASS="`. /usr/local/directadmin/conf/mysql.conf; echo $passwd;`"

mysqladmin ping -u $MYSQLUSER -p$MYSQLPASS

List fragmented tables

It would be very useful for this nice tool to show which tables are fragmented, not just the count. Perhaps in the recommendations at the bottom it could display the actual SQL to defragment all the relevant tables.

InnoDB is being used but MySQLTuner reports that it isn't.

$ perl mysqltuner.pl
>>  MySQLTuner 1.1.1 - Major Hayden <[email protected]>
>>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
>>  Run with '--help' for additional options and output filtering
[!!] Successfully authenticated with no password - SECURITY RISK!

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.51a-3ubuntu5.4-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster 
[!!] InnoDB is enabled but isn't being used
[OK] Total fragmented tables: 0

-------- Security Recommendations  -------------------------------------------
ERROR 1142 (42000) at line 1: SELECT command denied to user ''@'localhost' for table 'user'
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 2h 19m 2s (354K q [3.738 qps], 67 conn, TX: 886M, RX: 39M)
[--] Reads / Writes: 98% / 2%
[--] Total buffers: 296.0M global + 24.2M per thread (6 max threads)
[!!] Maximum possible memory usage: 441.1M (86% of installed RAM)
[OK] Slow queries: 0% (0/354K)
[OK] Highest usage of available connections: 83% (5/6)
[!!] Cannot calculate MyISAM index size - re-run script as root user
[OK] Query cache efficiency: 59.6% (208K cached / 349K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 68K sorts)
[!!] Temporary tables created on disk: 43% (816 on disk / 1K total)
[OK] Thread cache hit rate: 92% (5 created / 67 connections)
[OK] Table cache hit rate: 88% (45 open / 51 opened)
[OK] Open file limit used: 0% (23/8K)
[OK] Table locks acquired immediately: 100% (143K immediate / 143K locks)

-------- Recommendations -----------------------------------------------------
General recommendations:
  Add skip-innodb to MySQL configuration to disable InnoDB
  Reduce your overall MySQL memory footprint for system stability
  When making adjustments, make tmp_table_size/max_heap_table_size equal
  Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  tmp_table_size (> 128M)
  max_heap_table_size (> 64M)

Yet

$ mysql -uroot -Bse "SHOW TABLE STATUS FROM osr_production" | awk '{print $2,$7,$10}'
InnoDB 1589248 0
InnoDB 16384 0
InnoDB 16384 0
InnoDB 49152 0
InnoDB 7864320 0
InnoDB 2637824 0
InnoDB 16384 0
InnoDB 16384 0
InnoDB 16384 0
InnoDB 16384 0
InnoDB 16384 0
InnoDB 32768 0
InnoDB 16384 0
InnoDB 294912 0
InnoDB 16384 0
InnoDB 18366464 0

Can you help? Running Ubuntu 8.04 or 8.10.
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2

Modification of a read-only value attempted at mysqltuner.pl line 503 (#1)

OS: CentOS release 5.11 (Final)
Arch: x86_64
MySQL: 5.1.73-cll
MySQL packages installed:
cpanel-perl-514-DBD-mysql-4.027-2.cp1146
cpanel-mysql-libs-5.1.73-1.cp1136
cpanel-mysql-5.1.73-1.cp1136
Error:

MySQLTuner 1.5.0 - Major Hayden [email protected]
Bug reports, feature requests, and downloads at http://mysqltuner.com/
Run with '--help' for additional options and output filtering

Modification of a read-only value attempted at mysqltuner.pl line 503 (#1)
(F) You tried, directly or indirectly, to change the value of a
constant. You didn't, of course, try "2 = 1", because the compiler
catches that. But an easy way to do the same thing is:

    sub mod { $_[0] = 1 }
    mod(2);

Another way is to assign to a substr() that's off the end of the string.

Yet another way is to assign to a foreach loop VAR when VAR
is aliased to a constant in the look LIST:

        $x = 1;
        foreach my $n ($x, 2) {
            $n *= 2; # modifies the $x, but fails on attempt to modify the 2
        }

Uncaught exception from user code:
Modification of a read-only value attempted at mysqltuner.pl line 503.
at mysqltuner.pl line 503
main::get_tuning_info() called at mysqltuner.pl line 1630

mysqktuner crash

Hi, mysql tuner crashed when I run start it. Have you seen this error before? Here is the output:

# perl mysqltuner.pl 

>>  MySQLTuner 1.3.0 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
[OK] Logged in using credentials from debian maintenance account.
[OK] Currently running supported MySQL version 5.6.19-1~dotdeb.1-log
[OK] Operating on 32-bit architecture with less than 2GB RAM

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM 
[--] Data in MyISAM tables: 1M (Tables: 90)
[--] Data in InnoDB tables: 227M (Tables: 49)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[!!] Total fragmented tables: 9

-------- Security Recommendations  -------------------------------------------
[!!] User '@h2216817.stratoserver.net' has no password set.
[!!] User '@localhost' has no password set.
[!!] User 'seafile@%' has no password set.
Illegal division by zero at mysqltuner.pl line 642 (#1)
    (F) You tried to divide a number by 0.  Either something was wrong in
    your logic, or you need to put a conditional in to guard against
    meaningless input.

Uncaught exception from user code:
    Illegal division by zero at mysqltuner.pl line 642.
 at mysqltuner.pl line 642
    main::calculations() called at mysqltuner.pl line 1012

Support engines

+------------+---------+--------------+------+------------+ | Engine | Support | Transactions | XA | Savepoints | +------------+---------+--------------+------+------------+ | MyISAM | DEFAULT | NO | NO | NO | | InnoDB | YES | YES | YES | YES | | PBXT | YES | YES | YES | NO | | CSV | YES | NO | NO | NO | | MEMORY | YES | NO | NO | NO | | SPHINX | YES | NO | NO | NO | | Aria | YES | NO | NO | NO | | MRG_MYISAM | YES | NO | NO | NO | +------------+---------+--------------+------+------------+

http://pastebin.com/eBggss1u

Incorrect message for innodb instances pool calculations

I am just using currently mysqltuner and this was the output yesterday:
[OK] InnoDB buffer pool / data size: 13.0G/10.7G
[OK] InnoDB buffer pool instances: 13
[OK] InnoDB log waits: 0

Now with your current pulls I get:
-------- InnoDB Metrics -----------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB BufferPool Size :13.0G
[--] InnoDB BufferPool Inst :13
[OK] InnoDB buffer pool / data size: 13.0G/10.7G
[!!] InnoDB buffer pool <= 1Go and innodb_buffer_pool_instances(=1).
[OK] InnoDB log waits: 0

This looks faulty from your commit: 61ba60e

This is the related mysql configuration here:
innodb_buffer_pool_size = 13G
innodb_buffer_pool_instances = 13

file name of download is index.html

i downloaded the script like described on the website and it is named index.html.

# wget mysqltuner.pl
--2015-07-23 10:47:05--  http://mysqltuner.pl/
Resolving mysqltuner.pl (mysqltuner.pl)... 217.70.184.38
Connecting to mysqltuner.pl (mysqltuner.pl)|217.70.184.38|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl [following]
--2015-07-23 10:47:05--  https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl
Resolving raw.github.com (raw.github.com)... 23.235.43.133
Connecting to raw.github.com (raw.github.com)|23.235.43.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl [following]
--2015-07-23 10:47:06--  https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 23.235.43.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|23.235.43.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 78492 (77K) [text/plain]
Saving to: ‘index.html’

100%[==============================================================================================================>] 78,492      --.-K/s   in 0.01s

2015-07-23 10:47:06 (5.06 MB/s) - ‘index.html’ saved [78492/78492]

i had to rename it: mv index.html mysqltuner.pl

Ubuntu 14.04.2 LTS

Error with MySQL version 5.5.8-log

Here is the error

[root@381723 ~]# /home/mysqltuner.pl

MySQLTuner 1.1.1 - Major Hayden [email protected]
Bug reports, feature requests, and downloads at http://mysqltuner.com/
Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.8-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 304M (Tables: 63)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] InnoDB is enabled but isn't being used
[!!] Total fragmented tables: 2

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
Use of uninitialized value in multiplication (*) at /home/mysqltuner.pl line
666, <> line 2 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl tells you what operation
you used the undefined value in.  Note, however, that perl optimizes your
program and the operation displayed in the warning may not necessarily
appear literally in your program.  For example, "that $foo" is
usually optimized into "that " . $foo, and the warning will refer to
the concatenation (.) operator, even though there is no . in your
program.

Use of uninitialized value in division (/) at /home/mysqltuner.pl line 666, <>
line 2 (#1)

Illegal division by zero at /home/mysqltuner.pl line 666, <> line 2 (#2)
(F) You tried to divide a number by 0. Either something was wrong in
your logic, or you need to put a conditional in to guard against
meaningless input.

Uncaught exception from user code:
Illegal division by zero at /home/mysqltuner.pl line 666, <> line 2.
at /home/mysqltuner.pl line 665
main::calculations() called at /home/mysqltuner.pl line 918

Please help

MariaDB support

How well-supported is MariaDB by this script? I know it will work since MariaDB is binary-compatible with MySQL. However, can the script evaluate MariaDB-specific features/settings?

Query Cache Size warning only displays when query_cache_size is already > 128MB

I ran mysqltuner.pl on one of my instances, and got this result.
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
query_cache_size (> 128M)
table_open_cache (> 128)
innodb_buffer_pool_size (>= 4G)

The warning Increasing the query_cache size over 128M may reduce performance did not display.

I recommend changing line 921 from:
if ($myvar{'query_cache_size'} > 128*1024*1024) {
to
if ($myvar{'query_cache_size'} >= 128*1024*1024) {

Uninitialized Value when using Remote Host

Just heads up:

Use of uninitialized value $arch in string eq at mysqltuner.pl line 709, <>
line 2 (#1)
(W uninitialized) An undefined value was used as if it were already
defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl will try to tell you the
name of the variable (if any) that was undefined. In some cases it cannot
do this, so it also tells you what operation you used the undefined value
in.  Note, however, that perl optimizes your program and the operation
displayed in the warning may not necessarily appear literally in your
program.  For example, "that $foo" is usually optimized into "that "
. $foo, and the warning will refer to the concatenation (.) operator,
even though there is no . in your program.

Patch and test from windows

Hello,

Is there anybody try to run this script from a windows OS ?

Is it compatible with Windows ?

Best regards.

suggest to increase innodb_log_buffer_size

mysqltuner should check status of Innodb_log_waits and if it is not 0
innodb_log_buffer_size increase should be suggested, because innodb_log_waits shows
The number of waits we had because log buffer was too small and we had to wait for it to be flushed before continuing.

If/Else uses uninitialized value when InnoDB not enabled.

On a system with InnoDB disabled...

[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED -InnoDB +MRG_MYISAM 

MySQLTuner throws an error attempting to print the uninitialized value Innodb_log_waits at line 969.

Use of uninitialized value $mystat{"Innodb_log_waits"} in concatenation (.) or
    string at ./MySQLTuner/mysqltuner.pl line 969 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you the
    name of the variable (if any) that was undefined. In some cases it cannot
    do this, so it also tells you what operation you used the undefined value
    in.  Note, however, that perl optimizes your program and the operation
    displayed in the warning may not necessarily appear literally in your
    program.  For example, "that $foo" is usually optimized into "that "
    . $foo, and the warning will refer to the concatenation (.) operator,
    even though there is no . in your program.

[OK] InnoDB log waits: 

This is because the if/else block beginning at line 965 will execute even when have_innodb is undefined or set to NO and Innodb_log_waits being undefined triggers the else block which attempts to print Innodb_log_waits.

        if (defined $mystat{'Innodb_log_waits'} && $mystat{'Innodb_log_waits'} > 0) {
                badprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'};
                push(@adjvars,"innodb_log_buffer_size (>= ".hr_bytes_rnd($myvar{'innodb_log_buffer_size'}).")");
        } else {
                goodprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'};
        }

The solution seems to be shifting this if/else block up into the if block beginning at line 957 or adding a new else if to ensure that Innodb_log_waits is defined.

Use of uninitialized value $mycalc{"total_possible_used_memory"} in numeric gt

I experienced syntax error:

[--] Total buffers: 1.3G global + 36.2M per thread (100 max threads)
Use of uninitialized value $mycalc{"total_possible_used_memory"} in numeric gt
(>) at mysqltuner.pl line 1139 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl will try to tell you the
name of the variable (if any) that was undefined. In some cases it cannot
do this, so it also tells you what operation you used the undefined value
in.  Note, however, that perl optimizes your program and the operation
displayed in the warning may not necessarily appear literally in your
program.  For example, "that $foo" is usually optimized into "that "
. $foo, and the warning will refer to the concatenation (.) operator,
even though there is no . in your program.

Suggestion: table_cache recommendations might be off

First of all, many thanks for mysqltuner.pl. It is a great little app!

Second, I see that table_cache is almost always recommended very high in the variables to adjust (depending on my number of tables or temporary tables, of course). However, benchmarking apparently shows that it is not always good to increase it. See http://www.mysqlperformanceblog.com/2009/11/16/table_cache-negative-scalability/

I think it would be good to mention that in the General recommendations, or to do some kind of check to make sure the right value is suggested.

Script freezes after first line of Storage Engine Statistics

  • Redhat Enterprise Linux 6
  • Architecture = x86_64
  • MySQL version 5.5.39
  • OS yum package install
  • There was no error, but it just halted after the following line without progressing. I have to force exit the script:

[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM

Bareword found where operator expected at mysqltuner.pl line 9

localhost ~ $ perl mysqltuner.pl
Bareword found where operator expected at mysqltuner.pl line 9, near "<title>MySQLTuner"
(Missing operator before MySQLTuner?)
syntax error at mysqltuner.pl line 5, near "html>"
Unrecognized character \xC2; marked by <-- HERE after at master <-- HERE near column 56 at mysqltuner.pl line 9.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.