mysql
卸载旧版本Mysql
yum remove mysql
更新yum源头
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
清除yum缓存
yum clean all
重新建立yum缓存
yum makecache
安装Mysql
yum -y install mysql
yum -y install mysql-community-server
启动Mysql
service mysqld start
查看Mysql是否启动
service mysqld status
停止Mysql
service mysqld stop
重设密码
在 vim /etc/my.cnf添加代码
skip-grant-tables
将密码置空
update user set authentication_string=''where user = ‘root’
先设置一个符合规则的密码
alter user ‘root’@'localhost’identified by ‘Abc123…’;
查看当前默认规则
show variables like ‘validate_password%’;
修改校验密码策略等级
set global validate_password.policy=LOW;
设置密码长度至少为4
set global validate_password.length=4;
重新设置密码
alter user ‘admin’@‘%’ identified with mysql_native_password by ‘设置的密码’;
实现远程连接
查看用户连接mysql列表
select host,user,plugin from