1. 登录到mysql
1
mysqld -u root -p
  1. 输入以下命令
1
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '1024';