下载
- 选择 Red Hat Enterprise Linux / Oracle Linux
- 选择 Red Hat Enterprise Linux 8 / Oracle Linux (x86, 64-bit)
- 下载 RPM Bundle (mysql-8.0.26-1.el8.x86_64.rpm-bundle.tar) 这是多个rpm打包的文件
也可以直接在服务器上用wget
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.26-1.el8.x86_64.rpm-bundle.tar
安装
yum update
tar xvf mysql-8.0.26-1.el8.x86_64.rpm-bundle.tar
# 按顺序执行
rpm -ivh mysql-community-common-8.0.26-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.26-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.26-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-8.0.26-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.0.26-1.el8.x86_64.rpm
安装server时会要求perl和libaio, 如果没有安装, 需要先用yum install perl libaio
安装一下.
上面的安装结束后会提示
[root@db backup]# rpm -ivh mysql-community-server-8.0.26-1.el8.x86_64.rpm
warning: mysql-community-server-8.0.26-1.el8.x86_64.rpm: Header V3 DSA/SHA256 Signature, key ID 5072e1f5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-server-8.0.26-1.e################################# [100%]
[/usr/lib/tmpfiles.d/mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
参考
- https://access.redhat.com/solutions/4154291,
Due to the systemd change, any package using /var/run will need to be updated to attempt to remove the logs.
, 根据Systemd的修改, 任何使用 /var/run 这个目录的软件都需要更新路径来避免出现这个提示. - https://bugs.gentoo.org/768051
A workaround of this case is to edit /usr/lib/tmpfiles.d/mysql.conf
,Do not edit /usr/lib/tmpfiles.d/mysql.conf. Copy that file to /etc/tmpfiles.d and edit it there if you need to.
需要复制 /usr/lib/tmpfiles.d/mysq