本文共 454 字,大约阅读时间需要 1 分钟。
方法1
alter user 'root'@'localhost' identified by 'xaS@DrxGA#B*fXsq#g';flush privileges;
方法2
set password for 'root'@'localhost'=password('xaS@DrxGA#B*fXsq#g');flush privileges;
方法3
update mysql.user set authentication_string=password('xaS@DrxGA#B*fXsq#g') where User='root' and Host = 'localhost';update mysql.user set authentication_string=password('xaS@DrxGA#B*fXsq#g') where User='root' and Host = '%';flush privileges;
不需要重启服务,但是需要执行 flush privileges;
转载地址:http://mbaui.baihongyu.com/