MySQL provides the Yum Warehouse installation method for the following Linux platforms
El5,el6,el7 (Enterprise Linux 5,6,7)
Fedora22,fedora23
Make sure that no other third-party release RPM packages are installed in the system to install MySQL
MySQL installation steps
1, add the MySQL yum repository to the list of system warehouses.
A, select and download the corresponding RPM package on the page (http://dev.mysql.com/downloads/repo/yum/) For example ( MYSQL57-COMMUNITY-RELEASE-EL7-7.NOARCH.RPM).
B, execute the shell command (sudo yum localinstall mysql57-community-release-el7-{version-number}.noarch.rpm) to add the operation.
downloading packages:running transaction check Running transaction test Transaction Test succeeded Running Transaction is being installed: mysql57-community-release-el7-7. noarch1/1verified in: mysql57-community-release-el7-7. noarch1/1installed: mysql57-community-release.noarch0: el7-7It's over !
C, execute the shell command (yum repolist all | grep "Mysql.*-community.*") to check if the MySQL repository was added successfully.
MYSQL-CONNECTORS-COMMUNITY/X86_64 MySQL Connectors Community Enabled:1MySQL-connectors-community-source MySQL Connectors Community-sourc disabling MySQL-tools-community/x86_64 MySQL Tools Community enabled:2MySQL-tools-community-source MySQL Tools Community-Source Disable Mysql55-community/x86_64 MySQL5.5Community Server Disabled mysql55-community-source MySQL5.5Community Server-Sourc Disabling mysql56-community/x86_64 MySQL5.6Community Server Enabled: +mysql56-community-source MySQL5.6Community Server-Sourc Disabling mysql57-community/x86_64 MySQL5.7Community Server Disabled mysql57-community-source MySQL5.7Community SERVER-SOURC Disabled
2. Select the MySQL release version.
A, use the MySQL Yum repository by default with the latest GA version (currently MySQL 5.7), if this version is what you want, go directly to install MySQL.
b, due to the different distributions of MySQL in different Yum Sub-warehouses, the latest version of the sub-repository (currently MySQL 5.7) is enabled and the other sub-warehouses (5.5, 5.6) have a status of disabled.
Use the shell command (yum repolist all | grep mysql) to see the status of all the sub-warehouses.
C,disable the current sub-repository and enable the MySQL version of the repository you want to install.
The command is as follows:
sudo yum-config-manager--disable mysql57-Community
sudo yum-config-manager--enable mysql56-community
Alternatively, you can edit it in the/etc/yum.repos.d/mysql-community.repo file to achieve the same purpose.
[mysql57-Community] Name=mysql5.7Community Server BaseURL=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/Enabled=1Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-mysql
# Enable to use MySQL5.6[Mysql56-Community] Name=mysql5.6Community Server BaseURL=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/Enabled=1Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-mysql
D, use the shell command (yum repolist enabled | grep mysql) to check if the currently enabled sub-warehouse is the version you want to install.
mysql-connectors-community/x86_64 MySQL Connectors community 17 MySQL -tools-community/x86_64 MySQL Tools community 29 mysql56 -community/x86_64 MySQL 5.6 Community Server 199
3, install MySQL.
Install using the shell command (sudo yum install mysql-community-server). The command will also install additional Mysql-community-server
Required components such as Mysql-community-client,mysql-community-common,mysql-community-libs
4, start MySQL.
Use the shell command (sudo service mysqld start) to start the MySQL service.
Use the shell command (sudo service mysqld status) to view the status of the MySQL service.
done!
Installing MySQL on Linux using the source repository