mysql -u root -p
# 密码
USE mysql
# 修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '新密码';
flush privileges;
mysql -u test -p
输入新密码
mysql -u root -p
# 密码
USE mysql
# 修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '新密码';
flush privileges;
mysql -u test -p
输入新密码