mysql修改密码(命令行)

时间:2021-02-22 11:45:52   收藏:0   阅读:0

mysql8:

  alter user ‘root‘@‘localhost‘ identified by ‘123456‘;

mysql5.7:

  update user set authentication_string = password(‘123456‘) where user = ‘root‘ and Host = ‘localhost‘;

  flush privileges;

  如果flush 无效,就加上下面这句:

  grant all privileges on *.* to ‘root‘@‘localhost‘ identified by ‘123456‘ with grant option;

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!