vi /etc/percona-xtradb-cluster.conf.d/wsrep.cnf wsrep_node_address=172.16.1.13 wsrep_node_name=pxc-node-2 vim /etc/percona-xtradb-cluster.conf.d/wsrep.cnf wsrep_node_address=172.16.1.14 wsrep_node_name=pxc-node-3
vim /etc/percona-xtradb-cluster.conf.d/mysqld.cnf 添加:(mysqld模块中) skip-grant-tables # root没有密码 使用这个选项跳过权限认证
启动服务
1
systemctl restart mysql@bootstrap
登录mysql
1 2
mysql mysql> update mysql.user set authentication_string=PASSWORD("123.com") where User="root";
修改mysqld配置文件
1 2
vim /etc/percona-xtradb-cluster.conf.d/mysqld.cnf skip-grant-tables //删除
重启服务
1
systemctl restart mysql@bootstrap
登录mysql
1 2 3 4 5
mysql -u root -p123.com mysql> set password=PASSWORD("123.com"); mysql> alter user root@"localhost" password expire never; mysql> grant all on *.* to "sstuser"@"localhost" identified by "123.com"; mysql> flush privileges;