mysql安装包下载
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
安装mysql
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
启动服务
systemctl start mysqld.service
service mysqld status
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum install mysql-server
grep 'password' /var/log/mysqld.log
mysql -u root -p
授权访问
update user set host = '%' where user ='root';
flush privileges;
更改密码
set global validate_password_policy=0;
alter user 'root'@'localhost' identified by '123456';