共计 2125 个字符,预计需要花费 6 分钟才能阅读完成。
自动写代码机器人,免费开通
本篇文章为大家展示了如何在 Centos7 环境中安装 mysql 8.0.13,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。
环境说明
•操作系统: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,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注丸趣 TV 行业资讯频道。
向 AI 问一下细节