Install mysql on centos7 and centos7mysql
From centos7, to maintain a better open source, the default database of the minimal version of the system is changed to mariadb, I decided to install mysql (after all, there is a difference between the two storage engines, although mariadb is compatible with mysql). The following describes how to install mysql.
The mysql version that needs to be installed first is 6.0: http://mysql.mirrors.pair.com/Downloads/MySQL-6.0/ (using rpm package installation ).
1. Uninstall mariadb
At the beginning of installation, because mariadb of the system was not uninstalled, an installation directory conflict error occurred while installing mysql-server. The uninstall method is as follows:
Rpm-qa | grep mariadb # obtain the rpm package name of mariadb
Rpm-e -- nodeps rpm package name
2. Disable selinux
Cat/etc/selinux/config
Change the value of selinux from the original enforce to SELINUX = disabled, and then restart the computer (I use the source command to make the configuration file take effect immediately, but it seems ineffective, hope to find a better method in the future)
3. Install perl-DBI
Yum install perl-DBI
4. Install mysql6.0
Since the host is an intel CPU, the following three installation packages are installed in sequence:
MySQL-server-6.0.11-0.glibc23.x86_64.rpm (if the installation is successful, SUCCESS will be prompted! MySQL running)
MySQL-client-6.0.11-0.glibc23.x86_64.rpm
MySQL-devel-6.0.11-0.glibc23.x86_64.rpm
Run rpm-qa | grep MySQL to check whether the installation is successful:
MySQL-client-6.0.11-0.glibc23.x86_64
MySQL-server-6.0.11-0.glibc23.x86_64
MySQL-devel-6.0.11-0.glibc23.x86_64
5. initialize the root password
Mysqladmin-u root password New password
6. view the startup status
Chkconfig -- list mysql (Note: This output only displays the SysV service, and does not contain the native systemd service. The SysV configuration data may be overwritten by the native systemd configuration. You can use systemctl list-unit-files to list native services, or use systemctl list-dependencies [target] to view services enabled for specific targets)
Mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.