yum or rpm?
yum安裝方式很方便,但是下載mysql的時候從官網(wǎng)下載,速度較慢。
rpm安裝方式可以從國內(nèi)鏡像下載mysql的rpm包,比較快。rpm也適合離線安裝。
環(huán)境說明
•操作系統(tǒng):Centos7.4 (CentOS-7-x86_64-Minimal-1804.iso)
•mysql:mysql8.0.13
•卸載系統(tǒng)自帶的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
安裝依賴環(huán)境
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
關(guān)閉防火墻
systemctl stop firewalld.service
systemctl disable firewalld.service
禁用selinux
vi /etc/selinux/config
將SELINUX=enforcing改為SELINUX=disabled
reboot 重啟機器
從網(wǎng)易鏡像下載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,確保已經(jīng)卸載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
初始化數(shù)據(jù)庫
mysqld --initialize --console
目錄授權(quán),否則啟動失敗
chown -R mysql:mysql /var/lib/mysql/
啟動服務(wù)
systemctl start mysqld
加密
mysql_secure_installation
其他
其他操作和yum安裝方式一樣,不再重復(fù)。
安裝perl所有模塊
yum install -y perl-Module-Install.noarch
總結(jié)
以上所述是小編給大家介紹的Centos7 安裝mysql 8.0.13(rpm)的教程詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
您可能感興趣的文章:- CentOS7.6安裝MYSQL8.0的步驟詳解
- CentOS 6.2 安裝 MySQL 5.7.28的教程(mysql 筆記)
- CentOS7下mysql 8.0.16 安裝配置方法圖文教程
- centos7利用yum安裝mysql 8.0.12
- CentOS安裝配置MySQL8.0的步驟詳解
- CentOS7安裝GUI界面及遠程連接的實現(xiàn)
- CentOS7.2安裝MySql5.7并開啟遠程連接授權(quán)的教程
- Centos7下無法遠程連接mysql數(shù)據(jù)庫的原因與解決
- CentOS 8 安裝 MySql并設(shè)置允許遠程連接的方法