centos install mysql 5.7 and unauthorized remote access

Installing MySQL official Yum Repository

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

yum -y install mysql57-community-release-el7-10.noarch.rpm

Installation: yum -y install mysql-community-server
Start Service: systemctl start mysqld.service
Check the service status: systemctl status mysqld.service
Obtaining initial password: grep "password" /var/log/mysqld.log 
example: [Note] A temporary password is generated for root @ localhost: + qiCwZpTw7b5 this is the initial password + qiCwZpTw7b5
Login mysql: mysql -uroot -p
Create a root password: ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'password'; (in order to maintain the habit, no matter what the environment password are set to meet the password complexity)
If you do want to set a password that is similar to 123456, on the implementation of: 
the SET, Ltd. Free Join validate_password_policy = 0; set global validate_password_length = 1;
cancel password complexity
authorized mysql remote access
. GRANT ALL PRIVILEGES ON * * the TO 'root' @ '%' IDENTIFIED BY 'password';
quit quit mysql
After exiting mysql execute: yum -y remove mysql57-community-release-el7-10.noarch
Avoid be automatically updated after each yum


Guess you like

Origin www.cnblogs.com/2019peng/p/12103121.html