Install and configure MySQL in CentOS 7.2, centosmysql

Source: Internet
Author: User
Tags yum repolist

Install and configure MySQL in CentOS 7.2, centosmysql

1. Related configurations are as follows:

Operating System: CentOS 7.2

MySQL version: 5.7.x

Ii. Download and install

2.1 Download rpm package

Select the appropriate version: system version and package version. You can view the system version through uname-:

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

2.2 download and install the software source

sudo yum localinstall platform-and-version-specific-package-name.rpm

Platform-and-version-specific-package-name.rpm this is the match with the above, for the above example is also mysql57-community-release-el7-9.noarch.rpm.

Note:This operation adds MySQL Yum repository to the repository list of the system, and downloads the GnuPG key to check the integrity of the software package.

You can check whether the source is added to the system:

shell> yum repolist all | grep mysql

The output result of the above command is used to determine.

2.3 install MySQL

sudo yum install mysql-community-server

2.4 start MySQL Server

sudo systemctl start mysqld

You can view the server running status

systemctl status mysqld

To enable mysql to start up, run the following command:systemctl enable mysqld.service

Note:Is mysqld, there is a d.

2.5 initialization settings

mysql_secure_installation

This command requires you to set some password and other information.

All the steps are completed here. If you have any questions, refer to the following.

Iii. Problems

Q1. Login Password required for initialization:

Cause: a random temporary password will be generated during installation of MySQL 5.7 or above, which exists here:/var/log/mysqld.log To obtain the password:

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

Q2. Password Policy error

That is why the six-digit password cannot be set.

Cause: MySQL has a password verification plug-in to prevent the password setting from being too simple.

You can set a complex password first, and then change the password requirements to a simple one. The complex password requirements are as follows:

1. special characters

2. uppercase and lowercase letters

3. Number

4. 8 characters in length

Here is a demo password :! Aa112233.

After logging on with a new password, check the password-related variables:

SHOW VARIABLES LIKE 'validate_password%';+--------------------------------------+--------+| Variable_name            | Value |+--------------------------------------+--------+| validate_password_dictionary_file  |    || validate_password_length       | 8   || validate_password_mixed_case_count  | 1   || validate_password_number_count    | 1   || validate_password_policy       | MEDIUM || validate_password_special_char_count | 1   |+--------------------------------------+--------+

The above variables are password restrictions. You can change them to the following:

mysql> SET GLOBAL validate_password_policy = LOW;mysql> SET GLOBAL validate_password_length = 6;mysql> SET GLOBAL validate_password_number_count = 0;mysql> SET GLOBAL validate_password_mixed_case_count = 0;mysql> SET GLOBAL validate_password_special_char_count = 0;

Then you can set a 6-digit password.

Summary

The above is all the content of this article. I hope the content of this article will be helpful for your study or work. If you have any questions, please leave a message.

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.