Install MySQL5.6.22 on CentOS 7
1. installation environment
(1) CentOS version: CentOS-7
View method:
[Root @ bkjia desktop] # cat/etc/RedHat-release
CentOS Linux release 7.0.1406 (Core)
Source: download from the official website
: Http://www.centos.org/
MySQL edition: MySQL-5.6.22
Source: download from the official website
: Https://edelivery.oracle.com/EPD/Search/handle_go
Or Baidu Network Disk: http://pan.baidu.com/s/1o7zBDI6
Name: MySQL Database 5.6.22 RPM for Oracle Linux/RHEL 7x86 (64bit)
1. decompress the downloaded zip package and you will find the following rpm packages:
MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-devel-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-embedded-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-shared-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-shared-compat-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-test-advanced-5.6.22-1.el7.x86_64.rpm
2. Uninstall MariaDB
If you click "rpm package installation", an error is returned. Because the default CentOS database is no longer MySQL, but MariaDB, why?
The MariaDB database management system is a branch of MySQL. It is mainly maintained by the open-source community and licensed by GPL. One of the reasons for developing this branch is that after Oracle acquired MySQL, there is a potential risk of closing the source of MySQL. Therefore, the community uses the branch method to avoid this risk. MariaDB is designed to be fully compatible with MySQL, including APIs and command lines, so that it can easily become a substitute for MySQL.
View the currently installed mariadb package:
[Root @ bkjia desktop] # rpm-qa | grep mariadb
Unmount them all forcibly:
[Root @ bkjia desktop] # rpm-e-nodeps mariadb-libs-5.5.35-3.el7.x86_64
[Root @ bkjia desktop] # rpm-e-nodeps mariadb-5.5.35-3.el7.x86_64
[Root @ bkjia desktop] # rpm-e-nodeps mariadb-server-5.5.35-3.el7.x86_64
3. Install MYSQL
Double-click the following three packages for automatic installation:
MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-devel-advanced-5.6.22-1.el7.x86_64.rpm
MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
Tip: Actually, I don't know what the second package devel is, and I don't know if it is necessary (it should not be necessary to search online ), if no test is required, you have already installed it. You don't want to take the time to test whether it is required. If you have tested it, please leave a message to inform us.
4. Start MYSQL
[Root @ bkjia desktop] # service mysql start
ERROR: ERROR! The server quit without updating PID file
This is mainly because selinux is a disaster. If it is a centos system, selinux is enabled by default. The solution is to disable it, enable/etc/selinux/config, change SELINUX = enforcing to SELINUX = disabled, and then save the disk and restart the machine.
Then start mysql:
[Root @ bkjia desktop] # service mysql start
View the MySQL running status:
[Root @ bkjia desktop] # service mysql status
SUCCESS! MySQL running (2377)
If it is disabled, it cannot be operated.
[Root @ localhost ~] # Service mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost. localdomain. pid ).
[Root @ localhost ~] # Cd/var/lib/mysql
[Root @ localhost mysql] # less localhost. localdomain. err
[Root @ localhost mysql] # yum-y install autoconf
[Root @ localhost mysql] #/usr/bin/mysql_install_db -- user = mysql