CentOS7 installing MySQL using DNF

Source: Internet
Author: User

1. Install MySQL's yum repository

Execute the following command:

yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2. Install MySQL
dnf install mysql-community-server
3. Turn on MySQL service
service mysql start
4. Find the default password

To enhance security, MySQL5.7 randomly generates a password for the root user, in error log, about the location of the error log and, if the RPM package is installed, the default is/var/log/mysqld.log.
Only once you have started MySQL to view the temporary password, enter the following command to view the password:

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

The output is as follows:

[[email protected]_0_13_centos init.d]# grep 'temporary password' /var/log/mysqld.log                                                    2018-03-09T13:03:32.859149Z 1 [Note] A temporary password is generated for [email protected]: IVXhn:4E3uQ4  
5. Log in to MySQL and change the password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';

Changing the password will appear:

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Two global parameters must be modified:
First, modify the value of the Validate_password_policy parameter

Change the length of the password again

set global validate_password_length=1;

Execute the change password again.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
6. Authorize other machines to connect
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'passwort' WITH GRANT OPTION; //passwort改为mysql登陆密码FLUSH  PRIVILEGES;
7. Detailed description of password settings

Https://www.linuxidc.com/Linux/2016-01/127831.htm

CentOS7 installing MySQL using DNF

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.