Centos7 安装mysql 8.0.13(rpm)的教程详解
程序员文章站
2022-05-03 21:14:15
yum or rpm?
yum安装方式很方便,但是下载mysql的时候从官网下载,速度较慢。
rpm安装方式可以从国内镜像下载mysql的rpm包,比较快。rpm也适合...
yum or rpm?
yum安装方式很方便,但是下载mysql的时候从官网下载,速度较慢。
rpm安装方式可以从国内镜像下载mysql的rpm包,比较快。rpm也适合离线安装。
环境说明
•操作系统:centos7.4 (centos-7-x86_64-minimal-1804.iso)
•mysql:mysql8.0.13
•卸载系统自带的mariadb-lib
•查看mariadb版本
rpm -qa|grep mariadb mariadb-libs-5.5.56-2.el7.x86_64
•卸载mariadb
rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
安装依赖环境
yum install -y openssl-devel.x86_64 openssl.x86_64 yum install -y libaio.x86_64 libaio-devel.x86_64 yum install -y perl.x86_64 perl-devel.x86_64 yum install -y perl-json.noarch yum install -y autoconf yum install -y wget yum install -y net-tools
关闭防火墙
systemctl stop firewalld.service systemctl disable firewalld.service
禁用selinux
vi /etc/selinux/config
将selinux=enforcing改为selinux=disabled
reboot 重启机器
从网易镜像下载mysql安装包集合
•下载完整安装包并解压
wget https://mirrors.163.com/mysql/downloads/mysql-8.0/mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
•下载必要安装包(二选一)
wget https://mirrors.163.com/mysql/downloads/mysql-8.0/mysql-community-common-8.0.13-1.el7.x86_64.rpm wget https://mirrors.163.com/mysql/downloads/mysql-8.0/mysql-community-libs-8.0.13-1.el7.x86_64.rpm wget https://mirrors.163.com/mysql/downloads/mysql-8.0/mysql-community-client-8.0.13-1.el7.x86_64.rpm wget https://mirrors.163.com/mysql/downloads/mysql-8.0/mysql-community-server-8.0.13-1.el7.x86_64.rpm
按顺序安装
•必要安装(注意顺序)
•安装common
•安装lib 依赖于common,确保已经卸载mariadb
•依赖于libs
•依赖于client、common
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
•非必要安装(注意顺序)
rpm -ivh mysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm rpm -ivh mysql-community-embedded-compat-8.0.13-1.el7.x86_64.rpm rpm -ivh mysql-community-devel-8.0.13-1.el7.x86_64.rpm rpm -ivh mysql-community-test-8.0.13-1.el7.x86_64.rpm
初始化数据库
mysqld --initialize --console
目录授权,否则启动失败
chown -r mysql:mysql /var/lib/mysql/
启动服务
systemctl start mysqld
加密
mysql_secure_installation
其他
其他操作和yum安装方式一样,不再重复。
安装perl所有模块
yum install -y perl-module-install.noarch
总结
以上所述是小编给大家介绍的centos7 安装mysql 8.0.13(rpm)的教程详解,希望对大家有所帮助
上一篇: 这个极限运动我做过
推荐阅读
-
windows下安装mysql-8.0.18-winx64的教程(图文详解)
-
mysql8.0.18下安装winx64的详细教程(图文详解)
-
linux(Centos7)下安装mysql8.0.18的教程图解
-
Linux下Centos7安装Mysql5.7.19的详细教程
-
centos7上mysql8.0rpm方式安装教程图解
-
Linux系统(CentOS7安装)安装JDK8的教程详解
-
浅析CentOS6.8安装MySQL8.0.18的教程(RPM方式)
-
Centos7 下Mysql5.7.19安装教程详解
-
centos7 用rpm安装mysql详解
-
在 CentOS 7 中安装 MySQL 8 的教程详解