本次介绍捆绑包rpm方式安装mysql
首先到mysql官网:MySQL
1.下载捆绑包
2.上传至服务器
3.解压
tar -xvf mysql捆绑包.tar
4.重点来了,按照以下顺序分别安装(命令中的版本号按照自己下载的版本调整)
rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.32-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm
5.初始化数据库
mysqld --initialize --console
6.启动数据库
systemctl start mysqld
7.查看临时密码
cat /var/log/mysqld.log | grep password
8.正常连接就可以了