CentOS 安裝MySQL 5.7
1. 從mysql的官網下載mysql57-community-release-el6-8.noarch.rpm
2. 安裝第一步下載的rpm
rpm -ivh mysql57-community-release-el6-8.noarch.rpm
3. 安裝完成之後,我們發現在/etc/yum.repos.d目錄下新增了兩個檔案:其中第二檔案記錄了mysql的源資訊。
1 mysql-community.repo2 mysql-community-source.repo
4. 查看可用的mysql安裝源
yum repolist enabled | grep mysql 1 mysql-connectors-community MySQL Connectors Community 212 mysql-tools-community MySQL Tools Community 243 mysql57-community MySQL 5.7 Community Server 56
5. 使用yum安裝mysql(自動解決依賴問題,並安裝了其他相關包)(如果需要儲存下載的包,則修改/etc/yum.conf,將
keepcache=0 改為keepcache=1)
yum install mysql-community-server
Installing:
mysql-community-libs i686 5.7.13-1.el6 mysql57-community 2.0 M
replacing mysql-libs.i686 5.1.73-3.el6_5
mysql-community-libs-compat i686 5.7.13-1.el6 mysql57-community 1.6 M
replacing mysql-libs.i686 5.1.73-3.el6_5
mysql-community-server i686 5.7.13-1.el6 mysql57-community 140 M
Installing for dependencies:
mysql-community-client i686 5.7.13-1.el6 mysql57-community 22 M
mysql-community-common i686 5.7.13-1.el6 mysql57-community 327 k
Updating for dependencies:
postfix i686 2:2.6.6-6.el6_7.1 base 2.0 M
Transaction Summary
==============================================================================================
Install 5 Package(s)
Upgrade 1 Package(s)
6 .安裝完成之後,查看mysql服務的狀態
sudo service mysqld status mysqld (pid 26422)