Skip to main content

启动

在RHEL或CentOS 7上,使用以下引导命令:

systemctl start mysql@bootstrap.service

默认密码查看 命令 grep 'temporary password' /var/log/mysqld.log

[root@centos7-pxc1 ~]#  grep 'temporary password' /var/log/mysqld.log 
2020-05-19T11:11:48.295054Z 1 [Note] A temporary password is generated for root@localhost: eIIJg7dnQm+1

修改密码的方法:

mysql> alter user root@localhost identified by 'asdasd';

出现这个报错 检查是否开启了SELinux

2020-05-19T12:10:44.618622Z 0 [ERROR] WSREP: Failed to read 'ready <addr>' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.111.242' --datadir '/var/lib/mysql/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --parent '13669' --mysqld-version '5.7.29-32-57'   ''
Read: '(null)'
2020-05-19T12:10:44.618641Z 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.111.242' --datadir '/var/lib/mysql/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --parent '13669' --mysqld-version '5.7.29-32-57' '' : 2 (No such file or directory)
2020-05-19T12:10:44.618885Z 2 [ERROR] WSREP: Failed to prepare for 'xtrabackup-v2' SST. Unrecoverable.
2020-05-19T12:10:44.618895Z 2 [ERROR] Aborting

查看SELinux状态:

1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce                 ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0          ##设置SELinux 成为permissive模式

                              ##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可