(以root用户为例) 1.用原密码登录: mysql -u root -p Enter password:(输入root用户的密码登录) 2.选择数据库sql mysql> use sql; 3.修改密码: mysql> update user set password=password('new_password') where user='root';