Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Percona server through a source package

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to install Percona server through the source package. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Installing Percona Server from a Source Tarball1 downloads 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 and 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; make install

] #. / bootstrap

] # make

] # make install

3 create a related directory # 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 configure bulid using cmake] # cmake. -LH

] # cmake. \

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

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

-DSYSCONFDIR=/app/mysql\ # configuration file path. / etc is not specified because there are other mysql instances 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 inspection rules

Attached, if you have a cmake error, you need to re-cmake and clear the previous cmake information:

] # make clean

] # rm-f CMakeCache.txt

2 compiling #-j with make is followed by the number of logical CPU, which can be specified according to the actual situation.

] # make-j `grep processor / proc/cpuinfo | wc-l`

3 install using make install] # make install

6 create configuration file] # cat / app/mysql/my.cnf

[mysqld]

Basedir=/app/mysql

Datadir=/data/percona/mysql/data

Socket=/data/percona/mysql/mysql.sock

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

Innodb_buffer_pool_size = 128m

Port=6603

7 initialize db] #. / scripts/mysql_install_db-- defaults-file=/app/mysql/my.cnf

8 start percona mysql# Note: if the root account is used to initialize db, all the files generated are owned by root, while mysqld is run as mysql user. Without permission to the files generated by default, you may not be able to start normally, such as reporting an error:

26803 [Note] Plugin 'FEDERATED' is disabled.

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

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

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

2016-05-04 14:40:21 26803 [ERROR] Plugin 'InnoDB' init function returned error.

2016-05-04 14:40:21 26803 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2016-05-04 14:40:21 26803 [ERROR] Unknown/unsupported storage engine: InnoDB

2016-05-04 14:40:21 26803 [ERROR] Aborting

# at this point, change 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 process] # netstat-antpl | grep mysqld

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

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

10 View log] # tail-f / data/percona/mysql/mysqld.log

2016-05-04 14:42:02 27166 [Note] InnoDB: Waiting for purge to start

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

2016-05-04 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: 4eeaade7-11c3-11e6-86b0-782bcb6aa29a.

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

2016-05-04 14:42:02 27166 [Note] IPv6 is available.

2016-05-04 14:42:02 27166 [Note] -:: 'resolves to'::'

2016-05-04 14:42:02 27166 [Note] Server socket created on IP:':'

2016-05-04 14:42:02 27166 [Note] Event Scheduler: Loaded 0 events

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

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

11 Uninstall percona servera.Stop percona mysql server

B.rm-rf basedir & & rm-rf datadir

On "how to install Percona server through the source package" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report