One, download the corresponding version of the MySQL installation files
1. Download path: https://dev.mysql.com/downloads/mysql/
2, select the corresponding Linux version and x86/x64-bit installation files
To view the version information of Linux, refer to: View Centos/linux version information
I downloaded:mysql-5.7.20-1.el6.x86_64.rpm-bundle.tar
3. Decompression
To view the extracted files:
Ii. adding MySQL user groups and users
1. View user groups
Groups viewing the members of the currently logged on user group
Groups MySQL View the group that the MySQL user is in, and the members in the group
WHOAMI View the currently logged in user name
2. Adding user groups
Groupadd MySQL
Useradd- R- g MySQL -s/bin/false mysql
Note: The syntax or name of Groupadd and Useradd may be slightly different on different versions of UNIX systems, but should be done in CentOS6.5. This is done only to gain ownership of the system, not for login purposes; Use the Useradd command and the-R and-s/bin/false options to create a user who does not have logon rights.
Third, uninstall the old version of MySQL (if not, skip this step)
1. View the old version of MySQL
Rpm-qa | grep mysql
A list of components for the old version of MySQL will be listed, such as:
My computer only shows one here, there may be multiple.
2. Remove the old components one by one
Use the command to rpm -e --nodeps {-file-name}
remove the operation, there may be a dependency on removal, you should pay attention to a certain order.
The first time no deletion succeeded because there was one more space.
Iii. installing the MySQL component using the rpm command
Use rpm -ivh {-file-name}
the command to install the operation.
1[Email protected] downloads]#RPM-IVH mysql-community-common-5.7.20-1.el6.x86_64.rpm2warning:mysql-community-common-5.7. --1. El6.x86_64.rpm:Header V3 dsa/SHA1 Signature, key ID 5072e1f5:nokey3Preparing ... ########################################### [ -%]4 1: Mysql-community-common ########################################### [ -%]5[Email protected] downloads]#RPM-IVH mysql-community-libs-5.7.20-1.el6.x86_64.rpm6warning:mysql-community-libs-5.7. --1. El6.x86_64.rpm:Header V3 dsa/SHA1 Signature, key ID 5072e1f5:nokey7Preparing ... ########################################### [ -%]8 1: Mysql-community-libs ########################################### [ -%]9[Email protected] downloads]#RPM-IVH mysql-community-libs-compat-5.7.20-1.el6.x86_64.rpmTenwarning:mysql-community-libs-compat-5.7. --1. El6.x86_64.rpm:Header V3 dsa/SHA1 Signature, key ID 5072e1f5:nokey OnePreparing ... ########################################### [ -%] A 1: mysql-community-libs-co########################################### [ -%] -[Email protected] downloads]# rpm-ivh mysql-community-client-5.7.20-1. el6.x86_64.rpm -warning:mysql-community-client-5.7. --1. El6.x86_64.rpm:Header V3 dsa/SHA1 Signature, key ID 5072e1f5:nokey thePreparing ... ########################################### [ -%] - 1: Mysql-community-client ########################################### [ -%] -[Email protected] downloads]#RPM-IVH mysql-community-server-5.7.20-1.el6.x86_64.rpm -warning:mysql-community-server-5.7. --1. El6.x86_64.rpm:Header V3 dsa/SHA1 Signature, key ID 5072e1f5:nokey +Preparing ... ########################################### [ -%] - 1: Mysql-community-server ########################################### [ -%]
Note: In Ivh, i-install
Install; v-verbose
progress bar; h-hash
Hash Check
Iv. log in and create a MySQL password
1. Start MySQL
After installation, use the command to service mysqld start
start the MySQL service.
2.
Install MySQL RPM Bundle under Linux/centos