第一步:輸入 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