Centos7 安装mysql 8.0.13(rpm)的教程详解
yumorrpm?
yum安装方式很方便,但是下载mysql的时候从官网下载,速度较慢。
rpm安装方式可以从国内镜像下载mysql的rpm包,比较快。rpm也适合离线安装。
环境说明
•操作系统:Centos7.4(CentOS-7-x86_64-Minimal-1804.iso)
•mysql:mysql8.0.13
•卸载系统自带的mariadb-lib
•查看mariadb版本
rpm-qa|grepmariadb mariadb-libs-5.5.56-2.el7.x86_64
•卸载mariadb
rpm-emariadb-libs-5.5.56-2.el7.x86_64--nodeps
安装依赖环境
yuminstall-yopenssl-devel.x86_64openssl.x86_64 yuminstall-ylibaio.x86_64libaio-devel.x86_64 yuminstall-yperl.x86_64perl-devel.x86_64 yuminstall-yperl-JSON.noarch yuminstall-yautoconf yuminstall-ywget yuminstall-ynet-tools
关闭防火墙
systemctlstopfirewalld.service systemctldisablefirewalld.service
禁用selinux
vi/etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
reboot重启机器
从网易镜像下载mysql安装包集合
•下载完整安装包并解压
wgethttps://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar tar-xvfmysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
•下载必要安装包(二选一)
wgethttps://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-common-8.0.13-1.el7.x86_64.rpm wgethttps://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-libs-8.0.13-1.el7.x86_64.rpm wgethttps://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.13-1.el7.x86_64.rpm wgethttps://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-ivhmysql-community-common-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-libs-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-client-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-server-8.0.13-1.el7.x86_64.rpm
•非必要安装(注意顺序)
rpm-ivhmysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-embedded-compat-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-devel-8.0.13-1.el7.x86_64.rpm rpm-ivhmysql-community-test-8.0.13-1.el7.x86_64.rpm
初始化数据库
mysqld--initialize--console
目录授权,否则启动失败
chown-Rmysql:mysql/var/lib/mysql/
启动服务
systemctlstartmysqld
加密
mysql_secure_installation
其他
其他操作和yum安装方式一样,不再重复。
安装perl所有模块
yuminstall-yperl-Module-Install.noarch
总结
以上所述是小编给大家介绍的Centos7安装mysql8.0.13(rpm)的教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!