首页 > 数据库 >mysql 更换root密码简单操作

mysql 更换root密码简单操作

时间:2022-09-24 16:11:31浏览次数:51  
标签:set -- 密码 user mysql 123456 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

 

标签:set,--,密码,user,mysql,123456,root
From: https://www.cnblogs.com/a393060727/p/16725823.html

相关文章