标签:loading system undle cat 连接 修改 user sudo temporary
1,安装环境:centos 7.4 ,MySQL安装包:mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar ,两台服务器的IP分别为:192.168.112.129 ;192.168.112.130
分别安装下MySQL
2,解压MySQL的安装包
tar -xvf mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar
3,安装MySQL
yum localinstall *.rpm -y
4,重启MySQL
systemctl restart mysqld
5,查询数据库默认密码
sudo grep ‘temporary password‘ /var/log/mysqld.log
6,登录修改密码
mysql -u root -p
7,执行命令
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘password‘;
CREATE USER ‘root‘@‘%‘ IDENTIFIED BY ‘password‘;
grant all privileges on *.* to ‘root‘@‘%‘;
flush privileges;
8, 通过navicat等客户端测试连接
9,同样步骤 在另一台上执行相关安装命令
标签:loading system undle cat 连接 修改 user sudo temporary
原文地址:https://www.cnblogs.com/haichao1014/p/14818831.html