Mysqlreport _ MySQL-mysql tutorial

Source: Internet
Author: User
Mysqlreport using mysqlreport is a perl-based status report tool developed by www.hackmysql.com. it processes the output results of show status and show innodb status, making the output information more readable. Because it is a script written in perl, you must first install the perl environment and connect it with the mysql database. Therefore, you also need to install the database interface DBI and the database driver DBD-Mysql.

Install DBI

yum install -y perl-DBI

Install mysqlreport

wget http://hackmysql.com/scripts/mysqlreport-3.5.tgztar zxvf mysqlreport-3.5.tgzcd mysqlreport-3.5perl mysqlreport -u root -password 12345

Install_driver (mysql) failed: Can't locate DBD/mysql. pm in @ INC (@ INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/usr/lib/perl5/site_perl/5.8.8/usr/lib/perl5/site_perl/usr/lib/perl5/vendor_perl/5.8.8 /i386-linux-thread-multi/usr/lib/perl5/vendor_perl/5.8.8/usr/lib/perl5/vendor_perl/usr/lib/perl5/5.8.8/i386-linux-thread-multi/usr/lib/perl5/5.8.8 .) at (eval 8) line 3.
Perhaps the DBD: mysql perl module hasn' t been fully installed,
Or perhaps the capitalization of 'mysql' isn' t right.
Available drivers: DBM, ExampleP, File, Proxy, mongoge.
At./mysqlreport line 249

The preceding error occurs because DBD-mysql is not installed.

wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.020.tar.gzcd DBD-mysql-4.020perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_configmakemake install

Add the path of this mysql library file

echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.confldconfig

Use mysqlreport again

perl mysqlreport -u root -password 12345

There are some minor bugs in the script, and the following error message will appear:

Use of uninitialized value in multiplication (*) at mysqlreport line 829.Use of uninitialized value in formline at mysqlreport line 1227.Use of uninitialized value in formline at mysqlreport line 1235.

If you modify row 829 to the following method, no error is prompted.

my $is = @_;my $of = @_;return sprintf "%.2f", ($is * 100) / ($of ||= 1);

Analyze the errors of rows 1227 and 1235

1227 $stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'})
1235 $stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})

View mysql official manual

Innodb_buffer_pool_pages_latched

The number of latched pages in InnoDB buffer pool. these are pages currently being read or written or that cannot be flushed or removed for some other reason. calculation of this variable is expensive, so as of MySQL 5.1.28, it is available only when the UNIV_DEBUG system is defined at server build time.

This parameter is not provided by default after 5.1.28. Unless required during compilation.

Innodb_buffer_pool_read_ahead_seq

The number of sequential read-aheads initiatedInnoDB. This happens whenInnoDBDoes a sequential full table scan.

ForInnoDB Plugin, This variable was removed in MySQL 5.1.41.

This variable is the storage engine plug-in of InnoDB and has been removed since 5.1.41. here, my database is 5.5.25.

Finally, execute mysqlreport-u-password 12345. the following shows some output results.

This article is from the "old Xu's private food" blog and will not be reposted!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.