CentOS 7.2 Yum Way to install MySQL 5.7

Source: Internet
Author: User

After CentOS 7, the default source for Yum uses mariadb instead of the original MySQL, so there have been some changes to the installation method:

Download source for MySQL

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

Installing the Yum Library

Yum Localinstall-y mysql57-community-release-el7-7.noarch.rpm

Install MySQL

Yum Install-y mysql-community-server

Start the MySQL service

Systemctl Start Mysqld.service

MySQL5.7 strengthens the root user's security, so a random password is initialized after the first installation, the following is how to view the initial random password

grep ' temporary password '/var/log/mysqld.log

The results are as follows:

After logging in with the initial random password, MySQL will be forced to change the password, otherwise it would not work, (the password must contain lowercase, uppercase and special characters, of course, there are other methods not subject to this limitation, again do not describe more), modify the method as follows:

SET = PASSWORD ('your new PASSWORD'); ALTER USER ' Root '@'localhost'privileges;

Then you can sign in with your new password after exiting.

Remote Connection Authorization:

GRANT  All Privileges  on *. *  to ' Root '@ '%'by'your password'  with GRANT OPTION;

Open port (default 3306):

Firewall-cmd--add-port=3306/tcp

CentOS 7.2 Yum Way to install MySQL 5.7

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.