mysql 修改用户密码

修改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登录

猜你喜欢

转载自www.cnblogs.com/ultimateWorld/p/8920521.html