Mysql密码操作

修改密码

1.进入数据库c:\User\...>mysql -uroot -p

2.输入密码:

3.

method1:
mysql>alter user root@localhost identified by 'new password'

method2:
mysql> use mysql
mysql> update user set  authentication_string=password(‘new password') where user='root' and host='localhost';
mysql> flush privaileges;

method3:
set password for root@localhost=password('new password');

method4:不用进数据库

c:\users\...>mysqladmihn -uroot -p旧密码 password 新密码

 

posted @ 2021-04-22 20:46  Carrout  阅读(159)  评论(0编辑  收藏  举报