CentOS 7.4下MySQL 5.7.20主从环境搭建(M(2)

========================================================================================
Package 架构 版本 源 大小
========================================================================================
正在删除:
mariadb-libs x86_64 1:5.5.56-2.el7 @anaconda 4.4 M
为依赖而移除:
postfix x86_64 2:2.10.1-6.el7 @anaconda 12 M

事务概要
========================================================================================
移除 1 软件包 (+1 依赖软件包)

安装大小:17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在删除 : 2:postfix-2.10.1-6.el7.x86_64 1/2
正在删除 : 1:mariadb-libs-5.5.56-2.el7.x86_64 2/2
验证中 : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/2
验证中 : 2:postfix-2.10.1-6.el7.x86_64 2/2

删除:
mariadb-libs.x86_64 1:5.5.56-2.el7

作为依赖被删除:
postfix.x86_64 2:2.10.1-6.el7

完毕!

[root@xuegodslave ~]# yum -y install mysql-community-common-5.7.20-1.el7.x86_64.rpm
已加载插件:fastestmirror, langpacks
正在检查 mysql-community-common-5.7.20-1.el7.x86_64.rpm: mysql-community-common-5.7.20-1.el7.x86_64
mysql-community-common-5.7.20-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-common.x86_64.0.5.7.20-1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

========================================================================================
Package 架构 版本 源 大小
========================================================================================
正在安装:
mysql-community-common
x86_64 5.7.20-1.el7 /mysql-community-common-5.7.20-1.el7.x86_64 2.5 M

事务概要
========================================================================================
安装 1 软件包

总计:2.5 M
安装大小:2.5 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : mysql-community-common-5.7.20-1.el7.x86_64 1/1
验证中 : mysql-community-common-5.7.20-1.el7.x86_64 1/1

已安装:
mysql-community-common.x86_64 0:5.7.20-1.el7

完毕!

如上所示已经安装成功第一个包,同样的操作把剩下的三个包安装完毕!(主从服务器均进行同样操作)

步骤三,启动MySQL服务,并进行MySQL服务初始化(主从服务器均进行同样操作)

[root@mysqlmaster ~]# systemctl start mysqld

[root@mysqlmaster ~]# grep "password" /var/log/mysqld.log   查询mysql初始密码,
2018-05-12T14:50:13.167604Z 1 [Note] A temporary password is generated for root@localhost: Lil=#:VjS8*Z  (初始密码)

[root@mysqlmaster ~]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:      这里输入:Lil=#:VjS8*Z

The existing password for the user account root has expired. Please set a new password.

New password:    输入新密码  zX@987Weqqrd1

Re-enter new password:   重复一遍确认 zX@987Weqqrd1
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y 修改密码确认

New password:  再次输入  zX@987Weqqrd1

Re-enter new password:  再次输入  zX@987Weqqrd1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/d0dc1a0ec1963245a3681386c9c2b706.html