Loading

mysql修改密码

进入mysql, 执行如下命令: 

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

5.7以后版本修改密码: 

use mysql;
select plugin from user where user = 'root';
# 将指修改为默认值
update user set plugin='mysql_native_password';
# 修改密码
update user set authentication_string=password('root') where user='root' and host='localhost';
# 刷新权限
flush privileges;
# 修改密码
alter user 'root'@'localhost' identified by 'newPassword';

 

posted @ 2019-01-10 14:23  烟草的香味  阅读(99)  评论(0编辑  收藏  举报