1.以管理员身份启动cmd
2.登录mysql
mysql -uroot -pabc123
root 更改成账户名称
abc123 更改成账户密码
3.显示登录成功
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
4.输入以下指令(注意带#为注释部分)
#使用mysql数据库
USE mysql;
#修改'root'@‘localhost’用户的密码规则和密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'abc123';
#刷新权限
FLUSH PRIVILEGES;
5.输入后显示修改成功如下图
接下来就可以连接Mysql可视化工具啦~