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 Issues

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.

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

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.

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

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.

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)

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

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;";

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.

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

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.

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.

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.

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.

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?

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

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.

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)

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?

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

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.

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

[!!] 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 |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

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

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

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.

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,

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'};

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.

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.

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

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.

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

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.

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

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

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.