进入mysql目录下的bin目录执行mysql -u root -p
输入密码后执行下面指令,不要漏了指令后的分号。
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
进入mysql目录下的bin目录执行mysql -u root -p
输入密码后执行下面指令,不要漏了指令后的分号。
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;