mysql5.7 修改用户密码

修改vi /etc/my.cnf,增加skip-grant-tables可以免密码登录mysql

use mysql ;

update user set authentication_string=PASSWORD("123456") where user='root';

再次修改vi /etc/my.cnf,注释skip-grant-tables,重启mysql

mysql -uroot -p123456登录

注:mysql5.7后将password字段调整为authentication_string

posted @ 2018-04-23 17:25  乐-张蒙  阅读(2877)  评论(0编辑  收藏  举报