修改mysql和MariaDB密码

一、修改mysql密码

UPDATE user SET password=PASSWORD('new_password') WHERE user='root';

二、修改MariaDB密码

alter user 'root'@'localhost' identified by 'newPassword'; 
执行刷新权限,将上面的查询提交到系统中
flush privileges;

set password for 'root'@'localhost'=password('123456');

 

posted @ 2020-11-05 22:27  遥识楚人家  阅读(117)  评论(0编辑  收藏  举报