进入到终端当中,敲入 mysql -u root -p 命令然后回车,当需要输入密码时,直接按enter键,便可以不用密码登录到数据库当中
mysql> update user set password=password(“你的新密码”) where user=“root”;
mysql> flush privileges;
mysql> quit
注意:如果在执行该步骤的时候出现ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 错误。则执行下 flush privileges 命令,再执行该命令即可。
到这里root账户就已经重置成新的密码了。
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot exe
最新推荐文章于 2024-01-22 11:25:52 发布