mysql 修改密码

mysql8.0以前修改密码

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

flush privileges;

mysql8.0后修改密码

update user set authentication_string='' where user='root';
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

 

posted @ 2022-04-29 15:33  DaiWK  阅读(19)  评论(0编辑  收藏  举报