背景
在hw外包干久了,要废了,什么都要忘记了,感觉和外面脱节太大了,太危险了,赶紧复习一下压压惊。
准备rpm安装包
下载地址:https://www.mysql.com/cn/downloads/
图1:
图2:
图3:
开始安装
- 解压
- 依次执行以下安装
rpm -ivh mysql-community-common-8.0.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.33-1.el7.x86_64.rpm
说明:
不同版本,可能安装不同,可以根据提示进行安装:
[root@host31 mysql]# rpm -ivh mysql-community-server-8.0.33-1.el7.x86_64.rpm
warning: mysql-community-server-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
mysql-community-icu-data-files = 8.0.33-1.el7 is needed by mysql-community-server-8.0.33-1.el7.x86_64
[root@host31 mysql]# rpm -ivh mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm
如上是缺少icu-data-file,所以需要先安装它。
3. 启动mysql并且修改root密码,设置远程连接
启动:systemctl start mysqld
查看首次登录用户密码:cat /var/log/mysqld.log | grep password
登录,修改用户密码:alter user ‘root’@‘localhost’ identified by ‘XOox@123’,注意密码要满足大小写字符要求。
4. 连接测试
完成KO!