Linux版本:CentOS7.5
MySQL版本:8.0.13
1、下载MySQL8
下载地址:https://downloads.mysql.com/archives/community/
mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
选择版本和系统版本,然后Download。
2、安装MySQL8
登陆root用户。上传安装包到服务器(或者可以在服务器直接使用wget命令进行下载),并解压。
卸载mariadb,会与MySQL安装冲突。
rpm -qa | grep mariadb查看有无mariadb
[root@localhost tools]# ll
total 683252
-rw-r--r--. 1 root root 167741674 Nov 16 2016 jdk-8u112-linux-x64.rpm
-rw-r--r--. 1 root root 531906560 May 8 04:42 mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
[root@localhost tools]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
如果有则删除yum -y remove mariadb-libs.x86_64
[root@localhost tools]# yum -y remove mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost tools]# rpm -qa | grep mariadb
3、安装numactl
yum list installed|grep numactl
如果没有则yum install numactl,否则会在安装时报错
error:
Failed dependencies:
libnuma.so.1()(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64
[root@localhost tools]# yum list installed|grep numactl
numactl-libs.x86_64 2.0.9-7.el7 @anaconda
[root@localhost tools]# yum install numactl
[root@localhost tools]# yum list installed|grep numactl
numactl.x86_64 2.0.12-5.el7 @base
numactl-libs.x86_64 2.0.9-7.el7 @anaconda
[root@localhost tools]#
4、解压tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
安装4个必须安装的包(需要按顺序安装)。
rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
[root@localhost tools]# tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
安装依赖包
yum -y install net-tools openssl-devel.x86_64 openssl.x86_64 perl* perl.x86_64 perl-devel.x86_64 perl-JSON.noarch
[root@localhost tools]# ls
jdk-8u112-linux-x64.rpm
mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.13-1.el7.x86_64.rpm
mysql-community-common-8.0.13-1.el7.x86_64.rpm