Install Percona Server using the source code package

Source: Internet
Author: User
Tags percona percona server

Install Percona Server using the source code package

Install Percona Server using the source code package

1. Download the source code tar package.

Https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.29-76.2/source/tarball/percona-server-5.6.29-76.2.tar.gz

2. Install Cmake

Download cmake: https://cmake.org/download/

# Tar-zxvf cmake-2.8.9.tar.gz

# Cd cmake-2.8.9

# View help

# Cat Readme.txt

$./Bootstrap; make install

#./Bootstrap

# Make

# Make install

3. Create related directories

# Basedir

~ # Mkdir-p/app/mysql

# Datadir

~ # Mkdir-p/data/percona/mysql/data

~ # Chown mysql: mysql/app/mysql/-R

~ # Chown mysql: mysql/data/percona/mysql/-R

4. Decompress

# Tar-zxvf percona-server-5.6.29-76.2.tar.gz

# Cd percona-server-5.6.29-76.2

5. Compile and install

1. Use cmake to configure bulid

# Cmake.-LH

# Cmake .\

-DCMAKE_INSTALL_PREFIX =/app/mysql \ # Set the program installation path

-DMYSQL_DATADIR =/data/percona/mysql/data \ # Set the data storage path

-DSYSCONFDIR =/app/mysql \ # path of the configuration file. The/etc is not specified because other mysql instances are currently running.

-DWITH_MYISAM_STORAGE_ENGINE = 1 \ # enable the MYISAM storage engine

-DWITH_INNOBASE_STORAGE_ENGINE = 1 \

-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \

-DWITH_PERFSCHEMA_STORAGE_ENGINE = 1 \

-DWITH_FEDERATED_STORAGE_ENGINE = 1 \

-DMYSQL_UNIX_ADDR =/data/percona/mysql/mysqld. sock \ # Set the socket storage location

-DMYSQL_TCP_PORT = 6603 \ # Set the Open Port

-DENABLED_LOCAL_INFILE = 1 \ # Set to read local files

-DWITH_PARTITION_STORAGE_ENGINE = 1 \

-DEXTRA_CHARSETS = all-DDEFAULT_CHARSET = utf8 \ # default string

-DDEFAULT_COLLATION = utf8_general_ci # default check rule

Appendix. If cmake is incorrect, you need to re-Execute cmake and clear the previous cmake information:

# Make clean

# Rm-f CMakeCache.txt

2. Compile with make

#-J is followed by the number of logical CPUs, which can be specified based on the actual situation

# Make-j 'grep processor/proc/cpuinfo | wc-l'

3 install with make install

# Make install

6. Create a configuration file

# Cat/app/mysql/my. cnf

[Mysqld]

Basedir =/app/mysql

Datadir =/data/percona/mysql/data

Socket =/data/percona/mysql. sock

Log-error =/data/percona/mysql/mysqld. log

Innodb_buffer_pool_size = 128 M

Port = 6603

7. initialize the database

#./Scripts/mysql_install_db -- defaults-file =/app/mysql/my. cnf

8. Start percona mysql

# Note: if the root account is used to initialize the database, all generated files are owned by the root account, and mysqld is run by the mysql user. It has no permission for the default file generated and may fail to start normally, if an error is reported:

26803 [Note] Plugin 'federated 'is disabled.

/App/mysql/bin/mysqld: Can't find file: './mysql/plugin. frm' (errno: 13-Permission denied)

14:40:21 26803 [ERROR] InnoDB:./ibdata1 can't be opened in read-write mode

14:40:21 26803 [ERROR] InnoDB: The system tablespace must be writable!

14:40:21 26803 [ERROR] Plugin 'innodb' init function returned error.

14:40:21 26803 [ERROR] Plugin 'innodb' registry as a storage engine failed.

14:40:21 26803 [ERROR] Unknown/unsupported storage engine: InnoDB

14:40:21 26803 [ERROR] Aborting

# Modify the owner and group of files under basedir and datadir to mysql.

# Chown mysql: mysql/data/percona/mysql/-R

# Chown mysql: mysql/app/mysql/-R

# Start mysql again

#/Data/percona/mysql/bin/mysqld_safe -- defaults-file =/tmp/my. cnf &

160504 10:37:02 mysqld_safe Adding '/data/percona/mysql/lib/mysql/libjemalloc. so.1' to LD_PRELOAD for mysqld

160504 10:37:02 mysqld_safe Logging to '/data/percona/mysql/mysqld. log '.

160504 10:37:02 mysqld_safe Starting mysqld daemon with databases from/data/percona/mysql/data

9 view Processes

# Netstat-antpl | grep mysqld

Tcp 0 0: 6603: * LISTEN 27166/mysqld # percona mysql

Tcp 0 0 ::: 3306 ::: * LISTEN 23233/mysqld # default running mysql

10 view log

# Tail-f/data/percona/mysql/mysqld. log

14:42:02 27166 [Note] InnoDB: Waiting for purge to start

14:42:02 27166 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.29-76.2 started; log sequence number 1626426

14:42:02 27166 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: login.

14:42:02 27166 [Note] Server hostname (bind-address): '*'; port: 6603

14:42:02 27166 [Note] IPv6 is available.

14:42:02 27166 [Note]-': 'resolves '::';

14:42:02 27166 [Note] Server socket created on IP :'::'.

14:42:02 27166 [Note] Event schedents: Loaded 0 events

14:42:02 27166 [Note]/app/mysql/bin/mysqld: ready for connections.

Version: '5. 6.29-76.2 'socket:'/data/percona/mysql. sock 'port: 6603 Source distribution

11 uninstall percona server

A. Stop percona mysql server

B. rm-rf basedir & rm-rf datadir

How to install Percona Server on CentOS 7

Percona Server uses google-mysql-tools, Proven Scaling, and Open Query to transform MySQL.

An example of problem solving in CentOS compiling and installing Percona Server 5.5.42

Statistics on the differences between Percona Server 5.6 and 5.5

An example of problem solving in CentOS compiling and installing Percona Server 5.5.42

Percona Server details: click here
Percona Server: click here

This article permanently updates the link address:

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.