Install mysql5.7.17 on centos7.2

Source: Internet
Author: User

Install mysql5.7.17 on centos7.2

MariaDB is used in the default source of yum Versions later than CentOS 7 to replace the original MySQL version. Therefore, the installation method has changed a little bit:

Download the mysql Source

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

Install yum Library

Yumlocalinstall-ymysql57-community-release-el7-7.noarch.rpm

Install MySQL

Yuminstall-ymysql-community-server

Start MySQL Service

Systemctlstartmysqld. service

MySQL5.7 enhances the security of root users. Therefore, a random password is initialized after the first installation. The following describes how to view the initial random password.

Grep 'temporarypassword'/var/log/mysqld. log

The result is as follows:

After you log on with the initial Random Password, MySQL will force you to change the password. Otherwise, the password cannot be used normally. (The password must contain lower-case, upper-case letters, and special characters. Of course, other methods are not limited, ), The modification method is as follows:

SETPASSWORD = PASSWORD ('yourpassword'); alteruser'root' @ 'localhost' PASSWORDEXPIRENEVER; flushprivileges;

Then, log out with the new password.

Remote connection authorization:

GRANTALLPRIVILEGESON *. * TO 'root' @ '%' IDENTIFIEDBY 'yourpassword' WITHGRANTOPTION;

Port opened (3306 by default ):

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

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.