CentOS 7 Installation MySQL

Source: Internet
Author: User

Since MySQL was acquired by Oracle, the database built into the CentOS default Yum library changed from MySQL to MARIADB.

In order to install MySQL, we need to add the official MySQL repo to the CentOS repo.

Visit->mysql's official repo list

Find link Address: http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

On the CentOS command line, run

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

Add it to the Yum library.

Run

sudo yum install Mysql-server

Install MySQL

Run

sudo systemctl start mysqld

Start MySQL. Replace the start of the above command with Stop,restart,status, which corresponds to the original MySQL service command.

-------------------------

[[email protected] mysql]# mysql-u root MySQL

mysql> use MySQL;

mysql> desc User;

Mysql> GRANT All privileges on * * to [email protected]'% ' identified by ' root '; The ability to add remote connections for root

mysql> Update user Set Password = Password (' 123123 ') where user= ' root '; Set the root user password

Mysql> Select Host,user,password from User where user= ' root ';

mysql> flush Privileges;

Mysql> exit

Re-Login

[Email protected] mysql]# mysql-u root-p

Enter password:123123

If you are not able to connect remotely, turn off the firewall

[[Email protected]]# systemctl Stop Firewalld.service

CentOS 7 Installation 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.