赞
踩
yum -y install wget
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld
查看进程:
ps -ef | grep mysql
MySQL安装成功后会有一个临时密码,我们可以使用grep命令查看临时密码先登录进去MySQL,然后修改MySQL密码。
grep ‘temporary password’ /var/log/mysqld.log
mysql -uroot -p
ALTER user ‘root’@‘localhost’ IDENTIFIED BY ‘Qy165123!’;
修改成功后退出重新登陆
– 密码验证策略低要求(0或LOW代表低级)
set global validate_password.policy=0;
– 密码至少要包含的小写字母个数和大写字母个数
set global validate_password.mixed_case_count=0;
– 密码至少要包含的数字个数。
set global validate_password.number_count=0;
– 密码至少要包含的特殊字符数
set global validate_password.special_char_count=0;
– 密码长度
set global validate_password.length=4;
show variables like ’validate_password%‘;
ALTER user ‘root’@‘localhost’ IDENTIFIED BY ‘1234’;
sudo systemctl disable firewalld
1)首先登录MySQL
mysql -uroot -p1234
2)切换到mysql数据
use mysql;
3)查看user表
select Host,User from user;
4)修改为允许任何地址访问
update user set Host=‘%’ where User=‘root’;
5)刷新权限
flush privileges;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。