rpm -qa | grep mariadb
sudo rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
yum install -y mysql80-community-release-el7-7.noarch.rpm
yum repolist enabled | grep mysql.*
mysql80-community/x86_64 MySQL 8.0 Community Server 346
yum -y install mysql-community-server
systemctl start mysqld.service
查看一下运行状态
systemctl status mysqld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
grep "password" /var/log/mysqld.log
mysql -uroot -p
默认规则 大小字母,小写字母,特殊字符,8位
alter user user() identified by "123456Aa#";
use mysql;
update user set host = '%' where user = 'root';
select host, user from user;
授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
刷新
FLUSH PRIVILEGES;
设置自动启动
systemctl enable mysqld
systemctl daemon-reload
SHOW VARIABLES LIKE 'validate_password%';
设置密码验证强度
set global validate_password.policy=LOW;
设置密码长度
set global validate_password.length=4;
alter user user() identified by "123456";