语法:
mysqladmin -u root password “newpassword”
mysqladmin -u root -h host_name password “newpassword”
设置样例:
mysqladmin -u root password ws8dr8as3
mysqladmin -u root -h localhost password ws8dr8as3
设置完后要重启Mysql服务使新密码生效:
sudo /etc/init.d/mysql restart
网友评论