切换到数据表mysql
USE mysql;
SELECT * FROM USER;
mysql5.5修改密码
UPDATE USER SET PASSWORD=PASSWORD('你的密码') WHERE USER='root';
MySQL5.7修改密码
update mysql.user set authentication_string=password("新密码") where User="test" and Host="localhost";
//或者
ALTER USER test@'%' IDENTIFIED BY '123456';
FLUSH PRIVILEGES;
MySQL8.0修改密码 8.0加密方式改变
ALTER USER 'root'@'localhost' IDENTIFIED [WITH mysql_native_password] BY '你的密码';
//执行刷新
FLUSH PRIVILEGES;
//通过MySQLadmin修改密码,需要知道原密码
mysqladmin -u root -p password 1234;
mysql8.0以上密码策略限制必须要大小写加数字特殊符号
网友评论