修改Mysql 用户密码

1、切换数据库

use mysql;

2、修改密码

update user set host ='%' where user='root';
update user set password=password('1234') where user='root' and host='localhost';
update user set password=password('1234') where user='root' and host='127.0.0.1';

3、刷新权限

flush privileges;
posted @ 2022-11-18 09:43  鲸鱼zhang  阅读(25)  评论(0编辑  收藏  举报