cd /usr/local
mkdir mysql
cd mysql
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar
tar -xvf mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar
rpm -ivh mysql-community-common-8.0.16-2.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-libs-8.0.16-2.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-client-8.0.16-2.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm --nodeps --force
rpm -qa | grep mysql
mysqld --initialize;
!> 如果报错mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
# 安装对应依赖
yum install -y libaio.so.1
# 如果还是无法解决 进行下面操作
yum install -y libaio
chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;
systemctl enable mysqld;
cat /var/log/mysqld.log | grep password
https://zhuanlan.zhihu.com/p/368470304
https://blog.csdn.net/weixin_42266606/article/details/80879571