Percona5.7 source code installation, percona5.7 source code

Source: Internet
Author: User

Percona5.7 source code installation, percona5.7 source code
Introduction

The main purpose is to test the performance of the percona thread pool. Here we will briefly introduce the installation of percona5.7. The installation described in the percona official manual is very simple and will not be successful according to the above method.

 

Db: percona5.7.13

OS: centos6.7

 

Installation preparation

1. Create a user

groupadd mysqluseradd -r -g mysql mysql

2. Create a database directory

Mkdir-p/usr/local/percona -- installation directory mkdir-p/percona/data --- data DIRECTORY mkdir-p/percona/log

Install percona5.7

1. Download boost of 1.59.0

Http://www.boost.org/users/download/ download path

Note: The new version 1.59 is not supported. Download and decompress the package to the directory specified by-DWITH_BOOST.

2. Install the plug-in

yum install  readline-devel git gcc gcc-c++ make cmake bison bison-devel ncurses-devel libaio-devel perl

3. Compile and install

cmake   -DCMAKE_INSTALL_PREFIX=/usr/local/percona \-DMYSQL_UNIX_ADDR=/percona/data/mysql.sock \-DWITH_BOOST=/usr/local/percona/boost \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DWITH_MYISAM_STORAGE_ENGINE=1 \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DWITH_ARCHIVE_STORAGE_ENGINE=1 \-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \-DWITH_EDITLINE=bundled \-DENABLED_LOCAL_INFILE=1 \-DMYSQL_DATADIR=/percona/data \-DMYSQL_TCP_PORT=3306 \-DZLIB_INCLUDE_DIR:PATH=/usr/include \-DENABLE_DOWNLOADS=1
make  -j  8make install

4. initialize the database

./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/percona --datadir=/percona/data  --innodb_undo_tablespaces=3./bin/mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/percona --datadir=/percona/data 

5. Configure mysqlStart the service

Go to the source package file cp support-files/mysql. server/etc/init. d/mysqlchmod + x/etc/init. d/mysql -- Grant the file executable permission chkconfig mysql on -- configure mysql to automatically start service mysql start -- start MySQL

6. Configure Environment Variables

To directly call the mysql command, you need to configure the environment variable vim/etc/profile to add export PATH =/usr/local/percona/bin at the end of the/etc/profile file: $ PATH: make the environment variable take effect immediately. source/etc/profile

7. Set mysql rootUser Password

By default, the PASSWORD of the mysql root user is empty after installation. mysql-uroot --- log on to set password = PASSWORD ('root'); -- SET the root PASSWORD to run only local access use mysqlselect user by default, host from user where user = 'root'; GRANT the root remote connection permission, and use grant all privileges on * in the production environment with caution *. * TO 'root' @ '%' identified by 'root' with grant option;

8. Firewall Configuration

Port 3306 is disabled by default, enable port 3306 vim/etc/sysconfig/iptables and add the following content to the end of-a input-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT:-a input- m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT restart Firewall service iptables restart
Summary

The quick effect of the Connection Pool in Processing High concurrency is better than that in the oracle mysql Community edition, but it is not ideal for processing long queries. By default, mysql creates a thread for each connection of the client. When the number of threads increases, the number of context switches of CPU processing increases. The CPU time is usually consumed by context switching. The thread pool is used to control the number of threads to a certain extent and reduce the number of context switches. At the same time, its scheduling function can well manage the connection of client processes to the db thread pool. Note: To use the thread pool, you must set thread_handling to pool-of-threads.

 

 

 

 

Note:

Author: pursuer. chen

Blog: http://www.cnblogs.com/chenmh

All essays on this site are original. You are welcome to repost them. However, you must indicate the source of the article and clearly give the link at the beginning of the article.

Welcome to discussion

Related Article

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.