mysql 更换root密码简单操作

use mysql; --切换数据库

-- 更新密码

update user set authentication_string=password('123456') where user='root';

 

-- 刷新权限等信息
flush privileges;

 

执行结果如下:

use mysql
> OK
> 时间: 0.002s


update user
 set authentication_string=password('123456') where user='root'
> Affected rows: 0
> 时间: 0.008s


flush privileges
> OK
> 时间: 0.003s

 

posted on 2022-09-24 16:03  陈惟鲜的博客  阅读(149)  评论(0编辑  收藏  举报

导航