第一步:输入 mysql -u root -p 而后回车mysql
输入密码sql
第二步:输入 use mysql;ide
第三步:输入update user set authentication_string='' where user='root';将authentication_string置空blog
第四步:输入select user,host from user;string
第五步:输入alter user 'root'@'%' identified by '新密码';(注意:个人root host是%,若是user的host是localhost,就须要改为alter user 'root'@'localhost' identified by '新密码';)io