1. 程式人生 > >在CentOS中安裝Mysql

在CentOS中安裝Mysql

環境 路徑 log http linux 簡單 linu 5.7 yum

參考文檔 http://www.linuxidc.com/Linux/2016-09/135288.htm

安裝環境: CentOS7 64位

安裝版本: mysql5.7版本

安裝mysql有使用yum在線安裝也可以離線安裝,這裏只提供比較簡單在線在線安裝方式。

https://dev.mysql.com/downloads/repo/yum/

拉到最下面有下載選項:

技術分享圖片

獲得下載路徑,進行下載:

wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm

安裝mysql源

yum install
mysql57-community-release-el7-11.noarch.rpm

檢查mysql源

yum repolist enabled | grep "mysql.*-community.*"

技術分享圖片

調整mysql源的默認版本號:(修改對應版本下的enabled即可) 1啟用 0不啟用

vim /etc/yum.repos.d/mysql-community.repo

安裝mysql服務

yum install mysql-community-server

啟動mysql服務

systemctl start mysqld

查看服務狀態

systemctl status mysqld

在CentOS中安裝Mysql