Operate the following steps simultaneously on both machines
Install MySQL first, download the relative version of the RPM package from the official website
- mysql-community-client-5.7.23-1.el7.x86_64.rpm
- mysql-community-common-5.7.23-1.el7.x86_64.rpm
- mysql-community-libs-5.7.23-1.el7.x86_64.rpm
- MYSQL-COMMUNITY-LIBS-COMPAT-5.7.23-1.EL7.X86_64.RPM (* Resolution with Xtrabackup installation, MY.CNF conflict issues)
- mysql-community-server-5.7.23-1.el7.x86_64.rpm
Put them all in a breath, the provincial report relies on mistakes
RPM-IVH mysql-community-client-5.7. 1. el7.x86_64.rpm mysql-community-common-5.7. 1. el7.x86_64.rpm mysql-community-libs-5.7. 1. el7.x86_64.rpm mysql-community-libs-compat-5.7. 1. el7.x86_64.rpm mysql-community-server-5.7. 1. el7.x86_64.rpm
Initialize MySQL
Modify the permissions of the/var/lib/mysql/folder first, because it is installed with root permissions, you need to modify the permissions for MySQL.
chown -R mysql.mysql/var/lib/mysql/
Initialize MySQL
Mysqld--initialize
Get the initial password from Mysqld.log, get the red part of the password
Cat grep ' y password ' 2018--23t05: Si:1for(wrwawtoj14+
Log in to MySQL, change password
[Email protected] srv]# mysql-uroot-p'(wrwawtoj14+'MySQL: [Warning] Using a password on the command line interface can is insecure. Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connectionIDIs2Server Version:5.7. atCopyright (c) -,2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h' forHelp. Type'\c'ToClearThe current input statement.mysql> ALTER user [email protected] identified by'Root'; Query OK,0Rows Affected (0.01sec) MySQL>Exitbye
At this point, MySQL installation is complete
Installing Xtrabackup
Install according to the official website installation example: https://www.percona.com/doc/percona-xtrabackup/2.4/installation/yum_repo.html
1. Install Percona Yum Warehouse
Yum Install http://www.percona.com/downloads/percona-release/redhat/0.1-6/ percona-release-0.1-6.noarch.rpm
2, installation Xtrabackup 24
Yum Install percona-xtrabackup- -y
Will rely on installation (just because dependencies are always off-line, Yum is used):
To be installed as a dependency: 0:4.15-7. El7 perl0:4.023-6. El7 Perl0:1.17-245. El7
Perl 0:2.52-3. El7 0:3.1. 2-4. El7
At this point, two software installations are complete
Some pits in the above installation (have helped to jump over):
1, MySQL can not start, the CLI reported the following error
/bin/for"systemctl status mysqld.service""journalctl- Xe" for details.
/var/log/mysqld.log report the following error
2018- ,-23t06: ,: -.018182Z0[ERROR] Innodb:the Innodb_system Datafile 'ibdata1'must be writable2018- ,-23t06: ,: -.018188Z0[ERROR] Innodb:plugin initialization aborted with error Generic error2018- ,-23t06: ,: -.620670Z0[ERROR] Plugin'InnoDB'Initfunctionreturned error.2018- ,-23t06: ,: -.620698Z0[ERROR] Plugin'InnoDB'registration as a STORAGE ENGINE failed.2018- ,-23t06: ,: -.620703Z0[ERROR] Failed to initialize builtin plugins.2018- ,-23t06: ,: -.620706Z0[ERROR] Aborting
Workaround look at the MySQL initialization section above
2. Xtrabackup installation Conflict
file install of percona-server-shared--5.6. -rel84. 1 file from the package mysql-community-server-5.7. 1. el7.x86_64
Install mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm First
CentOS7 MySQL 5.7.23 & xtrabackup 24 Do data backup--install software