Install mysql on centos7 and centos7mysql

Source: Internet
Author: User
Tags install perl

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.