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+Mysql for CentOS7

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is about how CentOS7 installs Percona Server+Mysql. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

I. Environmental description

(1) CentOS-7-x86_64, kernel version

Uname-r3.10.0-693.el7.x86_64

(2) Mysql version

Percona-server-5.6.29

(3) File storage path

/ home/soft

Second, prepare before installation

(1) configure permissions

Groupadd mysqluseradd-r-g mysql mysql

(2) create an installation directory

Mkdir / usr/local/mysql # mysql installation directory chown-R mysql:mysql / usr/local/mysqlmkdir / usr/local/mysql/dataconf # Database configuration storage directory chown-R mysql:mysql / usr/local/mysql/dataconfmkdir / usr/local/mysql/sock # mysql.sock storage directory chown-R mysql:mysql / usr/local/mysql/sock mkdir / var/log/mysql when running mysql # create log storage directory touch / var/log/mysql/mysql.logchown-R mysql:mysql / var/log/mysql/mysql.log touch / usr/local/mysql/my.cnf # create mysql configuration file

Third, install the compilation environment

Yum install readline-devel git gcc gcc-c++ make cmake bison bison-devel ncurses-devel libaio-devel perl zlib1g-dev autoconf

IV. Compile and install percona

Cd / home/soft/tar zxvf percona-server-5.6.29-76.2.tar.gz cd percona-server-5.6.29-76.2cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql # needs to be installed using cmake Here is the file installation directory-DSYSCONFDIR=/usr/local/mysql # directory where configuration files are stored-DMYSQL_DATADIR=/usr/local/mysql/dataconf # directory where databases are stored-DMYSQL_UNIX_ADDR=/usr/local/mysql/sock/mysqld.sock # directory where mysql.sock files are stored-DMYSQL_TCP_PORT=3306-DWITH_MYISAM_STORAGE_ENGINE=1 # configuration port-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_PARTITION _ STORAGE_ENGINE=1-DEXTRA_CHARSETS=all-DDEFAULT_CHARSET=utf8 # configure the default character encoding format-DDEFAULT_COLLATION=utf8_general_ci-DENABLED_LOCAL_INFILE=1-DWITH_EDITLINE=bundled-DCMAKE_BUILD_TYPE=RelWithDebInfo-DBUILD_CONFIG=mysql_release-DFEATURE_SET=community-DWITH_EMBEDDED_SERVER=OFF

After that, continue with the compilation and installation.

Make-j 8 # will take about 30-40 minutes. If you report an error, please use make clean, rm-rf CMakeCache.txtmake install

5. Configure Percona parameters

Cat / usr/local/mysql/my.cnf [mysqld] # Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0explicit_defaults_for_timestamp=true federated# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group # customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemdbasedir=/usr/local/mysqldatadir=/usr/local/mysql/dataconfport=3306socket=/usr/local/mysql/sock/mysql.socksymbolic-links=0character_set_server=utf8pid-file=/usr/local/mysql/mysql.pidskip-grant-tables[mysqld_safe]log-error=/var/log/mysql/mysql.logpid-file=/usr/local/mysql/mysql.pidsocket=/usr/local/mysql/sock/mysql.sock[client] socket=/ Usr/local/mysql/mysql.sock [mysql.server] user=mysql basedir=/usr/local/mysql socket=/usr/local/mysql/sock/ mysql.sock[mysql] socket=/usr/local/mysql/sock/mysql.sock

6. Configure Mysql access rights

Chown-R mysql:mysql / usr/local/mysql/binchown-R mysql:mysql / usr/local/mysql/mysql.pid

Initialize the Mysql server

/ usr/local/mysql/scripts/mysql_install_db-defaults-file=/usr/local/mysql/my.cnf-basedir=/usr/local/mysql-datadir=/usr/local/mysql/dataconf-user=mysql

8. Configure environment variables

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

IX. Configure the startup script

Cp / home/soft/percona-server-5.6.29-76.2/support-files/mysql.server / etc/init.d/mysqlchmod + x / etc/init.d/mysqlchkconfig mysql onservice mysql start/stop

X. afterword

I don't know why this method can be used after installation in CentOS7, but can not be compiled and installed in Debian server. In addition, in the process of use, sometimes you may need the support of Percona-Server-client. To solve this problem, you can use the following methods: upload the file to the / home/soft/ directory and install it. The installation method is as follows:

Rpm-ivh Percona-Server-shared-compat-5.5.35-rel33.0.611.rhel6.x86_64.rpmrpm-ivh Percona-Server-shared-55-5.5.35-rel33.0.611.rhel6.x86_64.rpmrpm-ivh Percona-Server-devel-55-5.5.35-rel33.0.611.rhel6.x86_64.rpmrpm-ivh Percona-Server-client-55-5.5.35-rel33.0.611.rhel6.x86_64.rpm

Or use rpm-ivh * to install

Thank you for reading! This is the end of this article on "how to install CentOS7 Percona Server+Mysql". 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, you can 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