Centos7 installing MySQL

Source: Internet
Author: User

First CentOS7 already does not support MySQL, because charges you understand, so the internal integration of MARIADB, and install MySQL will and mariadb file conflict, so need to uninstall MARIADB, the following is uninstall MARIADB, install MySQL steps.

#列出所有被安装的rpm Package
Rpm-qa | grep mariadb

#卸载
Rpm-e mariadb-libs-5.5.44-2.el7.centos.x86_64
Error: Dependency detection failed:
libmysqlclient.so.18 () (64bit) was (installed) postfix-2:2.10.1-6.el7.x86_64 required
libmysqlclient.so.18 (libmysqlclient_18) (64bit) was (installed) postfix-2:2.10.1-6.el7.x86_64 needed

#强制卸载, because there is no--nodeps
RPM-E--nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64

#安装mysql依赖
Yum Install vim Libaio net-tools

The CentOS7 Yum source does not seem to have MySQL by default. To solve this problem, we need to download the MySQL repo source first.

1. Download the MySQL repo source

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

2. Install the MYSQL-COMMUNITY-RELEASE-EL7-5.NOARCH.RPM package

RPM-IVH mysql-community-release-el7-5.noarch.rpm

After installing this package, you will get two MySQL yum repo Source:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo.

3. Install MySQL

Yum Install Mysql-server

Follow the steps to install it, but after the installation is complete, there is no password and you need to reset the password.

4. Reset Password

Before resetting your password, you must first log in

Mysql-u Root

This error may be reported at login: Error 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2), on-line information says Because there is no authority, here I solemnly say, is because MySQL did not start, installation is finished without booting,

Start MySQL:

Service mysqld Start

Next login to reset Password:

Mysql-u Root

MySQL > Use mysql;

Change Password to not root

MySQL > UPDATE user SET password = password (' root ') WHERE user = ' root ';

Set up Telnet,

mysql > GRANT all privileges on * * to [email protected] '% ' identified by ' root ';

mysql > FLUSH privileges;

MySQL > exit;

Close CENTOS7 Firewall

CentOS 7.0 defaults to using firewall as the firewall

firewall-cmd--state # View firewall status

systemctl start Firewalld.service #启动firewall

systemctl Stop Firewalld.service #停止firewall

systemctl Disable Firewalld.service #禁止firewall开机启动

Centos7 installing MySQL

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.