1.登录数据库:mysql -uroot -p2.连接权限数据库>use mysql; (>是本来就有的提示符,别忘了最后的分号) 3.改密码:> update user set password=password("123456") where user="root"; (别忘了最后的分号) 4.刷新权限(必须的步骤)>flush privileges; 5.退出 > q 6.注销系统,再进入,开MySQL,使用用户名root和刚才设置的新密码123456登陆。