第一步:獲取mysql YUM源
進(jìn)入mysql官網(wǎng)獲取RPM包下載地址
https://dev.mysql.com/downloads/repo/yum/
右擊 復(fù)制鏈接地址 https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
得到rpm包的地址
第二步:下載和安裝mysql源
先下載 mysql源安裝包
[root@localhost ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
-bash: wget: 未找到命令
我們先安裝下wget
yum -y install wget
然后執(zhí)行 wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安裝mysql源
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm
第三步:在線安裝Mysql
yum -y install mysql-community-server
下載的東西比較多 要稍微等會(huì);
第四步:?jiǎn)?dòng)Mysql服務(wù)
systemctl start mysqld
第五步:設(shè)置開機(jī)啟動(dòng)
systemctl enable mysqld systemctl daemon-reload