MySQL 8.0后修改密码
官网链接:
https://dev.mysql.com/doc/refman/8.0/en/set-password.html
[root@localhost ~]# ./bin/mysql -u root -p '原来的密码' mysql> show databases; mysql> use mysql; mysql> ALTER USER '用户名'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码'; mysql> flush privileges; --刷新MySQL的系统权限相关表 mysql> exit;