cenos install mysql and configuration

One, install mysql

Download mysql:

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

installation

yum -y install mysql57-community-release-el7-10.noarch.rpm
Insert picture description here

The above error should be executed first

yum module disable mysql

Re-execute

yum -y install mysql-community-server
Insert picture description here


This is ok to install

Two, configure mysql

Start the mysql service

systemctl start  mysqld.service

View the mysql service status

systemctl status mysqld.service
Insert picture description here

View mysql password

grep "password" /var/log/mysqld.log
Insert picture description here

View mysql password

mysql -uroot  -p
Insert picture description here

View the mysql password format (the default must have uppercase and lowercase letters + special characters more than 8 digits)

SHOW VARIABLES LIKE 'validate_password%';
Insert picture description here

(Optional) Modify the password format to verify the lowest level and the lowest 4 digits

set global validate_password_policy=LOw;
set global validate_password_length=4;
Insert picture description here

Change password (password your password)

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

Open mysql remote connection (password your password)

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;

Reboot

flush privileges;