显示为> mysql 表示登录成功
方式1:
update mysql.user set authentication_string=password('root') where user='root' and Host = 'localhost’;方式2:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';解决办法1: |- 把密码修改为长一些, 符合【大写 + 小写 + 数字 + 特殊字符】如:alter user ‘root’@‘localhost’ identified by ‘CN.eee.123’;
解决办法2:调整安全策略 参考:https://www.cnblogs.com/ivictor/p/5142809.html |- set global validate_password_policy=0; |- set global validate_password_length=1;
再次执行修改密码即可。
mysql> use mysql; mysql> update user set host = ‘%’ where user = ‘root’; mysql> FLUSH PRIVILEGES;
参考:https://www.cnblogs.com/microtiger/p/7581175.html