How to install the DBI component in MySQL Benchmark test kit Benchmark _ MySQL

Source: Internet
Author: User
The MySQL Benchmark test Suite Benchmark is used to install the DBI component. Today, we plan to use the MySQL Benchmark Suite to test the insertion performance. The result is incorrect:

The code is as follows:
# Explain the environment
[Root @ beanvm ~] # Cat/etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
[Root @ beanvm ~] # Uname-
Linux beanvm 2.6.32-220. el6.i686 #1 SMP Wed Nov 9 08:02:18 EST 2011 i686 i686 i386 GNU/Linux
# Error
[Mysql @ beanvm ~] $ Cd/usr/local/mysql/SQL-scripts/
[Mysql @ beanvm SQL-plugin] $./test-insert -- server = mysql -- user = root -- password = mysql -- log
Can't locate DBI. pm in @ INC (@ INC contains: /usr/local/lib/perl5/usr/local/share/perl5/usr/lib/perl5/vendor_perl/usr/share/perl5/vendor_perl/usr/lib/perl5/usr /share/perl5 .) at. /test-insert line 33.
BEGIN failed -- compilation aborted at./test-insert line 33.

Obviously, the DBI component is missing. it is an important interface for perl to connect to the database. First, check whether this package exists.

The code is as follows:
[Mysql @ beanvm] $ rpm-qa | grep perl-DB

You can directly use yum for installation. here I use the installation package. Fortunately, these packages can be found in the installation media of RHEL6. you only need to install the following two packages:

The code is as follows:
[Root @ beanvm Packages] # rpm-ivh perl-DBI-1.609-4.el6.i686.rpm
Warning: perl-DBI-1.609-4.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ######################################## ### [100%]
1: perl-DBI ##################################### ###### [100%]
[Root @ beanvm Packages] # rpm-ivh perl-DBD-MySQL-4.013-3.el6.i686.rpm
Warning: perl-DBD-MySQL-4.013-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Error: Failed dependencies:
Libmysqlclient. so.16 is needed by perl-DBD-MySQL-4.013-3.el6.i686
Libmysqlclient. so.16 (libmysqlclient_16) is needed by perl-DBD-MySQL-4.013-3.el6.i686

When installing the perl-DBD-MySQL package, we found that libmysqlclient is missing. so.16 file. if MySQL is often installed, you should know libmysqlclient. so is a necessary library file in the MySQL database. is it not linked?

The code is as follows:
[Root @ beanvm ~] # Ls-l/usr/lib/libmysqlclient. so.16 *
[Root @ beanvm ~] # Ls-l/usr/local/mysql/lib/
Total 147260
-Rw-r --. 1 mysql 13322694 Feb 15 libmysqlclient.
Lrwxrwxrwx. 1 mysql 16 Feb 15 :39 libmysqlclient_r.a-> libmysqlclient.
Lrwxrwxrwx. 1 mysql 17 Feb 15 libmysqlclient_r.so-> libmysqlclient. so
Lrwxrwxrwx. 1 mysql 20 Feb 15 :39 libmysqlclient_r.so.18-> libmysqlclient. so.18
Lrwxrwxrwx. 1 mysql 24 Feb 15 14: 39 libmysqlclient_r.so.18.1.0-> libmysqlclient. so.18.1.0
Lrwxrwxrwx. 1 mysql 20 Feb 15 :39 libmysqlclient. so-> libmysqlclient. so.18
Lrwxrwxrwx. 1 mysql 24 Feb 15 14: 39 libmysqlclient. so.18-> libmysqlclient. so.18.1.0
-Rwxr-xr-x. 1 mysql 7654927 Feb 15 libmysqlclient. so.18.1.0
-Rw-r --. 1 mysql 129797464 Feb 15 libmysqld.
-Rw-r --. 1 mysql 10166 Feb 15 libmysqlservices.
Drwxr-xr-x. 3 mysql 4096 Feb 15 plug-in


We can see from the above results that the libmysqlclient. so.18 file already exists, but the version does not match. Therefore, we still need this libmysqlclient. so.16 file. Where can we find it? The easiest way is to install the MySQL-shared-compat package in the MySQL RPM installation kit: (my MySQL is compiled and installed, however, in the RPM suite of the same version, the MySQL-shared-compat-5.6.16-1.el6.i686.rpm package provides the necessary libmysqlclient. so.16 files. in this case, the compilation and deployment are not fully completed by RPM installation)

The code is as follows:
# My MySQL version: 5.6.16
[Root @ beanvm ~] # Rpm-ivh MySQL-shared-compat-5.6.16-1.el6.i686.rpm
Preparing... ######################################## ### [100%]
1: mySQL-shared-compat ################################### ####### [1, 100%]

Install the perl-DBD-MySQL-4.013-3.el6.i686.rpm again.

The code is as follows:
[Root @ beanvm Packages] # rpm-ivh perl-DBD-MySQL-4.013-3.el6.i686.rpm
Warning: perl-DBD-MySQL-4.013-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ######################################## ### [100%]
1: perl-DBD-MySQL ################################### ####### [1, 100%]

To sum up, it is recommended to install three packages in sequence for DBI installation:

The code is as follows:
# DBI installation package:
Perl-DBI-1.609-4.el6.i686.rpm
# Required library file packages. Note the version. libmysqlclient. so.16 is provided here.
MySQL-shared-compat-5.6.16-1.el6.i686.rpm
# DBD component
Perl-DBD-MySQL-4.013-3.el6.i686.rpm

After successful insertion, you can use Benchmark for Benchmark testing. The following is part of the data to test the insertion performance:

The code is as follows:
[Mysql @ beanvm SQL-plugin] $./test-insert -- server = mysql -- user = root -- password = mysql -- log
Testing server 'MySQL 5.6.16 'at 16:36:17

Testing the speed of inserting data into 1 table and do some selects on it.
The tests are done with a table that has 100000 rows.

Generating random keys
Creating tables
Inserting 100000 rows in order
Inserting 100000 rows in reverse order
Inserting 100000 rows in random order
Time for insert (300000): 879 wallclock secs (3.51 usr 1.21 sys + 0.00 cusr 0.00 csys = 4.72 CPU)

Testing insert of duplicates
Time for insert_duplicates (100000): 18 wallclock secs (3.81 usr 1.41 sys + 0.00 cusr 0.00 csys = 5.22 CPU)

Test of prepared + execute/once prepared specify execute selects
Time for prepared_select (100000): 31 wallclock secs (10.87 usr 1.81 sys + 0.00 cusr 0.00 csys = 12.68 CPU)
......

The machine is too bad, so ignore the data ..

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.