mysql8.x版本
mysql5.7 版本
,其中需要补充以下两点:
1)如果安装mysql的时候报错Failing package is: mysql-community-client-5.7.40-1.el7.x86_64 GPG Keys are configured as,密钥过期,要按以下方法:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
2)查询初始密码的时候如下:
[root@VM-2-185-centos bin]# grep 'temporary password' /var/log/mysqld.log
2023-12-05T05:45:29.627475Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: hTTS#V__H3xt
修改系统密码,授权一个账户远程访问。
mysql> alter user root@"localhost" identified by 'Fan.88888';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Fan.88888' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
因篇幅问题不能全部显示,请点此查看更多更全内容